# rc-checkbox
---
Checkbox ui component for react.
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependencies][david-image]][david-url]
[![DevDependencies][david-dev-image]][david-dev-url]
[![npm download][download-image]][download-url]
[![bundle size][bundlephobia-image]][bundlephobia-url]
[npm-image]: http://img.shields.io/npm/v/rc-checkbox.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-checkbox
[travis-image]: https://img.shields.io/travis/react-component/checkbox/master?style=flat-square
[travis-url]: https://travis-ci.org/react-component/checkbox
[circleci-image]: https://img.shields.io/circleci/react-component/checkbox/master?style=flat-square
[circleci-url]: https://circleci.com/gh/react-component/checkbox
[coveralls-image]: https://img.shields.io/coveralls/react-component/checkbox.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/checkbox?branch=master
[david-url]: https://david-dm.org/react-component/checkbox
[david-image]: https://david-dm.org/react-component/checkbox/status.svg?style=flat-square
[david-dev-url]: https://david-dm.org/react-component/checkbox?type=dev
[david-dev-image]: https://david-dm.org/react-component/checkbox/dev-status.svg?style=flat-square
[download-image]: https://img.shields.io/npm/dm/rc-checkbox.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-checkbox
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-checkbox
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-checkbox
## Install
[](https://npmjs.org/package/rc-checkbox)
## Usage
```js
import checkbox from 'rc-checkbox';
export default () =>
](http://godban.github.io/browsers-support-badges/)
IE / Edge | [
](http://godban.github.io/browsers-support-badges/)
Firefox | [
](http://godban.github.io/browsers-support-badges/)
Chrome | [
](http://godban.github.io/browsers-support-badges/)
Safari | [
](http://godban.github.io/browsers-support-badges/)
Electron |
| --- | --- | --- | --- | --- |
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
## API
| name | type | default | description |
|---|---|---|---|
| prefixCls | String | rc-checkbox | |
| className | String | '' | additional class name of root node |
| name | String | same with native input checkbox | |
| checked | enum: 0,1,2 | ||
| defaultChecked | enum: 0,1,2 | 0 | same with native input checkbox |
| onChange | Function(e:Event, checked:Number) | called when checkbox is changed. e is native event, checked is original checked state. |