JavaScript CSS
Clone or download
Latest commit 2b4f0d9 Jan 17, 2018
Permalink
Failed to load latest commit information.
assets fix less code style Apr 12, 2017
examples Converted demo component to ES6 Jun 17, 2017
src Add focus() blur() and autoFocus Nov 15, 2017
tests Add focus() blur() and autoFocus Nov 15, 2017
.editorconfig clean Apr 29, 2015
.gitignore Ignore lock files Nov 15, 2017
.npmignore optimize Jul 8, 2015
.travis.yml fix travis and scripts Apr 12, 2017
HISTORY.md Bump 1.6.0 Nov 15, 2017
LICENSE.md Added LICENSE.md Dec 21, 2016
README.md add disabled prop Jan 17, 2018
index.js optimize Jul 8, 2015
package.json Bump 1.6.0 Nov 15, 2017

README.md

rc-switch


switch ui component for react.

NPM version build status Test coverage gemnasium deps node version npm download

Feature

  • support ie8,ie8+,chrome,firefox,safari

install

rc-switch

Usage

import ReactDOM from 'react-dom';
import Switch from 'rc-switch';

ReactDOM.render(<Switch />, container);

API

props

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
tabIndex number tab-index of switch node
onClick Function(checked) called when switch is clicked
autoFocus boolean get focus when mounts
disabled boolean false whether switch is disabled

Development

npm install
npm start

Online demo: http://react-component.github.io/switch/examples/

License

rc-switch is released under the MIT license.