@feizheng/react-ant-switch
v1.0.0
Published
React ant switch.
Readme
react-ant-switch
React ant switch.
installation
npm install -S @feizheng/react-ant-switchupdate
npm update @feizheng/react-ant-switchproperties
| 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 "~@feizheng/react-ant-switch/dist/style.scss";
// customize your styles:
$react-ant-switch-options: ()- import js
import React from 'react';
import ReactDOM from 'react-dom';
import ReactAntSwitch from '@feizheng/react-ant-switch';
import './assets/style.scss';
class App extends React.Component {
componentDidMount() {}
render() {
return (
<div className="app-container">
<ReactAntSwitch
onChange={(e) => {
console.log('value:', e.target.value);
}}
/>
</div>
);
}
}
ReactDOM.render(<App />, document.getElementById('app'));
documentation
- https://afeiship.github.io/react-ant-switch/
license
Code released under the MIT license.
