# rc-checkbox
---
Checkbox ui component for react.
[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]
[![build status][github-actions-image]][github-actions-url]
[![Codecov][codecov-image]][codecov-url]
[![bundle size][bundlephobia-image]][bundlephobia-url]
[![dumi][dumi-image]][dumi-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.com/react-component/checkbox
[github-actions-image]: https://github.com/react-component/checkbox/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/checkbox/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/checkbox/master.svg?style=flat-square
[codecov-url]: https://app.codecov.io/gh/react-component/checkbox
[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/package/rc-checkbox
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-checkbox
[dumi-url]: https://github.com/umijs/dumi
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
## 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. |