switch ui component for react
- support ie8,ie8+,chrome,firefox,safari
var Switch = require('rc-switch');
var React = require('react');
React.render(<Switch />, container);| name | type | default | description |
|---|---|---|---|
| prefixCls | String | rc-switch | |
| className | String | '' | additional class name of root node |
| checked | boolean | false | whether switch is checked |
| defaultChecked | boolean | false | whether switch is checked on init |
| onChange | Function | called when switch is checked or unchecked |
npm install
npm start
http://localhost:8001/examples/
online example: http://react-component.github.io/switch/examples/
http://localhost:8001/tests/runner.html?coverage
rc-switch is released under the MIT license.
