react-multiple-select-dropdown
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

react-multiple-select-dropdown(tiny now!!)

NPM JavaScript Style Guide

Install

npm install --save react-multiple-select-dropdown

Usage

import React, { Component } from 'react'
import MultipleSelect from 'react-multiple-select-dropdown';
import 'react-multiple-select-dropdown/dist/index.css';
 
class YourWrapperComponent extends Component {
  // drop your items here.it could be thousands(we use virtual list so there is no problem)
  state = {
    selectedOptions: [],
    options: [
    { value: 1, label: 'react' },
    { value: 2, label: 'reactnative' },
    { value: 3, label: 'nodejs' },
    { value: 4, label: 'redux' },
    { value: 5, label: 'mobx' }
    ]
  }
 
  onChange = (selectedOptions) => {
    this.setState({ selectedOptions: selectedOptions });
  }
 
  render() {
  const { selectedItems, options } = this.state;
  return (
    <div>
      <MultipleSelect
        selectedOptions={selectedItems}
        options={options}
        onChange={this.onChange}
      />
    </div>
);
}

to see props go to docs

feel free to report bugs and request feature

License

MIT © arminyahya

/react-multiple-select-dropdown/

    Package Sidebar

    Install

    npm i react-multiple-select-dropdown

    Weekly Downloads

    12

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    398 kB

    Total Files

    21

    Last publish

    Collaborators

    • arminyahya