@jswork/react-ant-checkbox

1.0.0 • Public • Published

react-ant-checkbox

Checkbox for antd.

version license size download

installation

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

properties

Name Type Required Default Description
className string false - The extended className for component.
value bool false - The controlled value.
defaultValue bool false - Default value.
onChange func false noop The 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: ()
  1. 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.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/react-ant-checkbox

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

20.7 kB

Total Files

7

Last publish

Collaborators

  • afeiship