react-multiselect-box

A multiselect box component for React.

Usage no npm install needed!

<script type="module">
  import reactMultiselectBox from 'https://cdn.skypack.dev/react-multiselect-box';
</script>

README

React Multi-Select-Box

Description

A multiselect box component for React. This use react-virtualized and is based on an old jquery plugin.

Demo

Live demo: https://facuesr.github.io/react-multiselect-box/

Installation

npm install react-multiselect-box --save

Then, you can import react-multiselect-box in your app as follows:

import MultiSelectBox from 'react-multiselect-box'
import 'react-multiselect-box/build/css/index.css'

Usage

<MultiSelectBox
  options={[
    { desc: 'Item 1', value: '1' },
    { desc: 'Item 2', value: '2' },
    { desc: 'Item 3', value: '3' }
  ]}
  labelKey="desc"
  valueKey="value"
  onAdd={selectedItem => {

  }}
  onRemove={(removedItem, index) => {

  }}
  onSelectAll={selectedItems => {

  }}
  onRemoveAll={() =>

  }
  valueArray={[2,3]}
/>

Contributors

Thanks Federico Vicente for help with the styles.

License

MIT Licensed.