1.0.0 • Published 4 years ago

@feizheng/react-ant-switch v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

react-ant-switch

React ant switch.

version license size download

installation

npm install -S @feizheng/react-ant-switch

update

npm update @feizheng/react-ant-switch

properties

NameTypeRequiredDefaultDescription
classNamestringfalse-The extended className for component.
valueboolfalse-The runtime value.
defaultValueboolfalse-Default value.
onChangefuncfalsenoopThe change handler.

usage

  1. import css

    @import "~@feizheng/react-ant-switch/dist/style.scss";
    
    // customize your styles:
    $react-ant-switch-options: ()
  2. 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

license

Code released under the MIT license.