react-checkbox-list
A bootstrap-style react component for checkbox list
This is a simple react component that takes a meta data, translates it into a checkbox list and provides selected values when user changes selection. That's all it does.
Install
npm install react-checkbox-listorbower install react-checkbox-list
Usage
Simply require it to use it:
var CheckBoxList = ;
Compose it in render method:
render: function() { // supply initial data var data = [ {value: 'apple', label: 'Apple'}, {value: 'orange', label: 'Orange'}, {value: 'banana', label: 'Banana', checked: true} // check by default ]; return( );}
Listen for changes and get the selected values:
{ // values is array of selected item. e.g. ['apple', 'banana']}
Uncheck all items:
{ thisrefschkboxList;}
That's it for the API!
License
MIT.