react-stylable-checkbox
Installation
npm install react-stylable-checkbox
Usage
; <CustomCheckbox checked=true sign="check_black" color="red" onChange={console} />
Examples with different options
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.