0.9.7 • Published 3 years ago

@antlerengineering/multiselect v0.9.7

Weekly downloads
129
License
MIT
Repository
-
Last release
3 years ago

MultiSelect npm latest release Minified size

A component to select multiple items from a list of options using the Material-UI Autocomplete component.

Storybook badge

Full documentation with props

Quick start

To use, you must provide at least the value, onChange, and options props. You should also provide a label and labelPlural prop. By default, the component is in multi-select mode and values are strings.

<MultiSelect
  value={value} // From useState
  onChange={setValue} // From useState
  options={['The Shawshank Redemption', 'The Godfather', ...]}
  label="Movie"
  labelPlural="Movies"
/>

options prop

The simplest value for the options prop is an array of strings.

If you need more control over the value returned by MultiSelect, pass an array of Option objects, which must follow this type:

type Option<T = string> = {
  value: T;
  label: string;
  disabled?: boolean;
};

value and onChange prop types depend on the multiple prop

value must be an array of T in multi-select mode.

In single-select mode, it must be either T itself or null.

The first parameter of onChange follows the same type as value.

1.0.0-0

3 years ago

0.9.8-1

3 years ago

0.9.8-0

3 years ago

0.9.7

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.6

3 years ago

0.9.5

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.8

3 years ago

0.7.6

3 years ago

0.7.5

3 years ago

0.7.7

3 years ago

0.7.4

3 years ago

0.7.2

3 years ago

0.7.3

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.15

4 years ago

0.3.14

4 years ago

0.3.13

4 years ago

0.3.12

4 years ago

0.3.11

4 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago