Coder Social home page Coder Social logo

react-ant-filter-dropdown-checkbox's Introduction

react-ant-filter-dropdown-checkbox

Filter dropdown for checkbox.

version license size download

installation

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

properties

Name Type Required Default Description
className string false - The extended className for component.
value array false - Default value.
items array false [] The dropdown menu items.
selectAllText any false '全选' Select all text.
onChange func false noop The change handler.

usage

  1. import css
@import "~@jswork/react-ant-filter-dropdown-checkbox/dist/style.css";

// or use sass
@import "~@jswork/react-ant-filter-dropdown-checkbox/dist/style.scss";

// customize your styles:
$react-ant-filter-dropdown-checkbox-options: ()
  1. import js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactAntFilterDropdownCheckbox from '@jswork/react-ant-filter-dropdown-checkbox';
import './assets/style.scss';

class App extends React.Component {
  state = { value: [] };
  render() {
    const items = [
      { value: 'blank', label: '空白单元格' },
      { value: 'not-filled', label: '未填单元格' },
      { value: 'fixed', label: '已修正' }
    ];
    const { value } = this.state;
    return (
      <ReactDemokit
        className="p-3 app-container"
        url="https://github.com/afeiship/react-ant-filter-dropdown-checkbox">
        <ReactAntFilterDropdownCheckbox
          items={items}
          onChange={(e) => {
            this.setState({ value: e.target.value });
          }}
        />

        <div className="code-container">
          <div className="is-code">
            <pre>
              <code>{JSON.stringify(items, null, 2)}</code>
            </pre>
          </div>
          <div className="is-code">
            <pre>
              <code>{JSON.stringify(value, null, 2)}</code>
            </pre>
          </div>
        </div>
      </ReactDemokit>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('app'));

documentation

license

Code released under the MIT license.

react-ant-filter-dropdown-checkbox's People

Contributors

afeiship avatar

Stargazers

Jarrian Gojar avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.