1.0.1 • Published 1 year ago

wowjoy-switch v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

wowjoy-switch


Switch ui component for react.

Install

rc-switch

Usage

import Switch from 'wowjoy-switch';

export default () => <Switch />;

Compatibility

IE / EdgeFirefoxChromeSafariElectron
IE11, Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

API

PropertyTypeDefaultDescription
prefixClsStringrc-switch
classNameString''additional class name of root node
checkedbooleanfalsewhether switch is checked
defaultCheckedbooleanfalsewhether switch is checked on init
onChangeFunction(checked, event)called when switch is checked or unchecked
tabIndexnumbertab-index of switch node
onClickFunction(checked, event)called when switch is clicked
autoFocusbooleanget focus when mounts
disabledbooleanfalsewhether switch is disabled
loadingIconReact.ReactNodespecific the extra node. generally used in loading icon.

Development

npm install
npm start

License

rc-switch is released under the MIT license.