11# rc-checkbox
2+
23---
34
4- React Checkbox component.
5+ Checkbox ui component for react .
56
67[ ![ NPM version] [ npm-image ]] [ npm-url ]
7- [ ![ npm download] [ download-image ]] [ download-url ]
88[ ![ build status] [ travis-image ]] [ travis-url ]
9- [ ![ Test coverage] [ codecov-image ]] [ codecov-url ]
10- [ ![ Dependencies] ( https://img.shields.io/david/react-component/checkbox.svg?style=flat-square )] ( https://david-dm.org/react-component/checkbox )
11- [ ![ DevDependencies] ( https://img.shields.io/david/dev/react-component/checkbox.svg?style=flat-square )] ( https://david-dm.org/react-component/checkbox?type=dev )
9+ [ ![ Test coverage] [ coveralls-image ]] [ coveralls-url ]
10+ [ ![ Dependencies] [ david-image ]] [ david-url ]
11+ [ ![ DevDependencies] [ david-dev-image ]] [ david-dev-url ]
12+ [ ![ npm download] [ download-image ]] [ download-url ]
13+ [ ![ bundle size] [ bundlephobia-image ]] [ bundlephobia-url ]
1214
1315[ npm-image ] : http://img.shields.io/npm/v/rc-checkbox.svg?style=flat-square
1416[ npm-url ] : http://npmjs.org/package/rc-checkbox
15- [ travis-image ] : https://img.shields.io/travis/react-component/checkbox/master.svg ?style=flat-square
17+ [ travis-image ] : https://img.shields.io/travis/react-component/checkbox/master?style=flat-square
1618[ travis-url ] : https://travis-ci.org/react-component/checkbox
17- [ codecov-image ] : https://img.shields.io/codecov/c/github/react-component/checkbox.svg?style=flat-square
18- [ codecov-url ] : https://codecov.io/gh/react-component/checkbox
19+ [ circleci-image ] : https://img.shields.io/circleci/react-component/checkbox/master?style=flat-square
20+ [ circleci-url ] : https://circleci.com/gh/react-component/checkbox
21+ [ coveralls-image ] : https://img.shields.io/coveralls/react-component/checkbox.svg?style=flat-square
22+ [ coveralls-url ] : https://coveralls.io/r/react-component/checkbox?branch=master
23+ [ david-url ] : https://david-dm.org/react-component/checkbox
24+ [ david-image ] : https://david-dm.org/react-component/checkbox/status.svg?style=flat-square
25+ [ david-dev-url ] : https://david-dm.org/react-component/checkbox?type=dev
26+ [ david-dev-image ] : https://david-dm.org/react-component/checkbox/dev-status.svg?style=flat-square
1927[ download-image ] : https://img.shields.io/npm/dm/rc-checkbox.svg?style=flat-square
2028[ download-url ] : https://npmjs.org/package/rc-checkbox
29+ [ bundlephobia-url ] : https://bundlephobia.com/result?p=rc-checkbox
30+ [ bundlephobia-image ] : https://badgen.net/bundlephobia/minzip/rc-checkbox
2131
2232## Install
2333
@@ -26,62 +36,65 @@ React Checkbox component.
2636## Usage
2737
2838``` js
29- import ' rc-checkbox/assets/index.css' ;
30- import Checkbox from ' rc-checkbox' ;
39+ import checkbox from ' rc-checkbox' ;
3140
32- ReactDOM . render ( < Checkbox / > , container) ;
41+ export default () => < checkbox / > ;
3342```
3443
35- ## API
44+ ## Compatibility
45+
46+ | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Electron |
47+ | --- | --- | --- | --- | --- |
48+ | IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
3649
37- ### props
50+ ## API
3851
3952<table class =" table table-bordered table-striped " >
40- <thead>
53+ <thead >
54+ <tr >
55+ <th style="width: 100px;">name</th>
56+ <th style="width: 50px;">type</th>
57+ <th style="width: 50px;">default</th>
58+ <th>description</th>
59+ </tr >
60+ </thead >
61+ <tbody >
62+ <tr>
63+ <td>prefixCls</td>
64+ <td>String</td>
65+ <td>rc-checkbox</td>
66+ <td></td>
67+ </tr>
68+ <tr>
69+ <td>className</td>
70+ <td>String</td>
71+ <td>''</td>
72+ <td>additional class name of root node</td>
73+ </tr>
74+ <tr>
75+ <td>name</td>
76+ <td>String</td>
77+ <td></td>
78+ <td>same with native input checkbox</td>
79+ </tr>
80+ <tr>
81+ <td>checked</td>
82+ <td>enum: 0,1,2</td>
83+ <td></td>
84+ <td></td>
85+ </tr>
86+ <tr>
87+ <td>defaultChecked</td>
88+ <td>enum: 0,1,2</td>
89+ <td>0</td>
90+ <td>same with native input checkbox</td>
4191 <tr>
42- <th style="width: 100px;">name</th >
43- <th style="width: 50px;">type</th >
44- <th style="width: 50px;">default</th >
45- <th>description</th >
92+ <td>onChange</td >
93+ <td>Function(e:Event, checked:Number)</td >
94+ <td></td >
95+ <td>called when checkbox is changed. e is native event, checked is original checked state.</td >
4696 </tr>
47- </thead>
48- <tbody>
49- <tr>
50- <td>prefixCls</td>
51- <td>String</td>
52- <td>rc-checkbox</td>
53- <td></td>
54- </tr>
55- <tr>
56- <td>className</td>
57- <td>String</td>
58- <td>''</td>
59- <td>additional class name of root node</td>
60- </tr>
61- <tr>
62- <td>name</td>
63- <td>String</td>
64- <td></td>
65- <td>same with native input checkbox</td>
66- </tr>
67- <tr>
68- <td>checked</td>
69- <td>enum: 0,1,2</td>
70- <td></td>
71- <td></td>
72- </tr>
73- <tr>
74- <td>defaultChecked</td>
75- <td>enum: 0,1,2</td>
76- <td>0</td>
77- <td>same with native input checkbox</td>
78- <tr>
79- <td>onChange</td>
80- <td>Function(e:Event, checked:Number)</td>
81- <td></td>
82- <td>called when checkbox is changed. e is native event, checked is original checked state.</td>
83- </tr>
84- </tbody>
97+ </tbody >
8598</table >
8699
87100## Development
@@ -91,24 +104,7 @@ npm install
91104npm start
92105```
93106
94- ## Examples
95-
96- http://localhost:8001/examples/
97-
98- online example: http://react-component.github.io/checkbox/examples/simple.html
99-
100- ## Test Case
101-
102- ```
103- npm test
104- ```
105-
106- ## Coverage
107-
108- ```
109- npm run coverage
110- open coverage
111- ```
107+ Online demo: http://react-component.github.io/checkbox/
112108
113109## License
114110
0 commit comments