react-checkbox
![Coverage Status](https://coveralls.io/repos/github/trendmicro-frontend/react-checkbox/badge.svg?branch=master)
![NPM](https://nodei.co/npm/@trendmicro/react-checkbox.png?downloads=true&stars=true)
React Checkbox
Demo: https://trendmicro-frontend.github.io/react-checkbox
Installation
- Install the latest version of react and react-checkbox:
npm install --save react @trendmicro/react-checkbox
- At this point you can import
@trendmicro/react-checkbox
and its styles in your application as follows:
import Checkbox from '@trendmicro/react-checkbox';
import '@trendmicro/react-checkbox/dist/react-checkbox.css';
Usage
<Checkbox />
<Checkbox defaultChecked />
<Checkbox defaultIndeterminate />
<Checkbox indeterminate />
<Checkbox disabled />
<label className="checkbox">
<Checkbox />
Normal
</label>
<Checkbox
ref={node => {
this.checkbox = node;
}}
/>
API
Properties
Name | Type | Default | Description |
---|
defaultChecked | Boolean | false | Specify default checked status for checkbox |
defaultIndeterminate | Boolean | false | Specify default indeterminate status for checkbox |
indeterminate | Boolean | false | Force indeterminate status for checkbox |
disabled | Boolean | false | Specify disabled status for checkbox |
Name | Type | Description |
---|
checked | Boolean | Get checked status |
indeterminate | Boolean | Get indeterminate status |
License
MIT