Skip to content

Checkbox

Radi Cho edited this page Mar 30, 2018 · 3 revisions

RSGCheckbox is a relatively newer component introduced in 2.0.13
Preview:
RSGCheckbox

Usage

You have to use the following code:

import React from 'react';
import ReactDOM from 'react-dom';
import { RSGCheckbox } from 'rsg-components';

class MainComponent extends React.Component {
  render(){
    return(
      <div>
        <RSGCheckbox/>
      </div>
    )
  }
}

var app = document.getElementById('app');
ReactDOM.render(<MainComponent />, app);

RSGCheckbox is a void element tag and must not have children!

In version 3.0.0-beta.1 and later RSG is removed from the components so you have to use only Checkbox instead of RSGCheckbox

Props

RSGCheckbox provides only one prop unique to itself named large, which has to be either true or false.

The RSGCheckbox can also be passed all standard props React inputs accept (although not all of them will be functional). More info here.

It only SUPPORTS usage of the style, checked and onChange props which React inputs accept. Use of other props is strictly unsupported (though all of them which do not manipulate the element should work).


RSGCheckbox was worked very hard upon to be made as elegant as possible, much more than the other components.
Every developer can read a small tutorial and learn how to build his own checkbox styles - more information here (written by @radi-cho).

View codepen source here.

npm install rsg-components --save
or
yarn add rsg-components

Clone this wiki locally