1.0.0 • Published 4 years ago

@jswork/react-ant-checkbox v1.0.0

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

react-ant-checkbox

Checkbox for antd.

version license size download

installation

npm install -S @jswork/react-ant-checkbox

properties

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

usage

  1. import css

    @import "~@jswork/react-ant-checkbox/dist/style.css";
    
    // or use sass
    @import "~@jswork/react-ant-checkbox/dist/style.scss";
    
    // customize your styles:
    $react-ant-checkbox-options: ()
  2. import js

    import ReactDemokit from '@jswork/react-demokit';
    import React from 'react';
    import ReactDOM from 'react-dom';
    import ReactAntCheckbox from '@jswork/react-ant-checkbox';
    import './assets/style.scss';
    
    class App extends React.Component {
      state = { value: false };
      render() {
        return (
          <ReactDemokit
            className="p-3 app-container"
            url="https://github.com/afeiship/react-ant-checkbox">
            <article class="message is-info">
              <div class="message-header">Output</div>
              <div class="message-body">
                <ReactAntCheckbox
                  value={this.state.value}
                  onChange={(e) => {
                    this.setState({ value: e.target.value });
                  }}
                >
                  轻轻的点击我
                </ReactAntCheckbox>
              </div>
            </article>
    
            <article class="message">
              <div class="message-header">Output</div>
              <div class="message-body">{JSON.stringify(this.state.value)}</div>
            </article>
          </ReactDemokit>
        );
      }
    }
    
    ReactDOM.render(<App />, document.getElementById('app'));

documentation

license

Code released under the MIT license.