1.0.0 • Published 4 years ago
@jswork/react-ant-switch v1.0.0
react-ant-switch
React ant switch.
installation
npm install -S @jswork/react-ant-switch
properties
Name | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | - | The extended className for component. |
value | bool | false | - | The runtime value. |
defaultValue | bool | false | - | Default value. |
onChange | func | false | noop | The change handler. |
usage
import css
@import "~@jswork/react-ant-switch/dist/style.css"; // or use sass @import "~@jswork/react-ant-switch/dist/style.scss"; // customize your styles: $react-ant-switch-options: ()
import js
import ReactDemokit from '@jswork/react-demokit'; import React from 'react'; import ReactDOM from 'react-dom'; import ReactAntSwitch from '@jswork/react-ant-switch'; import './assets/style.scss'; class App extends React.Component { render() { return ( <ReactDemokit className="p-3 app-container" url="https://github.com/afeiship/react-ant-switch"> <ReactAntSwitch onChange={(e) => { console.log('value:', e.target.value); }} /> </ReactDemokit> ); } } ReactDOM.render(<App />, document.getElementById('app'));
documentation
license
Code released under the MIT license.
1.0.0
4 years ago