react-stylable-checkbox
v1.0.2
Published
custom react checkbox
Downloads
218
Maintainers
Readme
react-stylable-checkbox
Installation
npm install react-stylable-checkbox
Usage
import CustomCheckbox from 'react-stylable-checkbox';
<CustomCheckbox
checked={true}
sign={"check_black"}
color={"red"}
onChange={(isChecked)=>{console.log(isChecked)}}
/>
Options
- checked (boolean) - state of the checkbox, true by default
- sign (string) - the sign (choose between "check_white", "check_black", "x_white", "x_black")
- color (string) - the background color of the checkbox (also supports hex or rgb)
- onClick (function) - requires callback
- size (string) - the size of the checkbox in px
- isHollow (boolean) - the look of the checkbox when unchecked ( isHollow={false} by default)
- disabled (boolean, default: false) - disabled state for the checkbox; once disabled the onClick callback does not fire anymore
Licence
The code is open-source and available under the MIT Licence.