Basic

Apple
Banana
Cherry
Grape
Kiwi
Mango
Orange
Peach
Pear
Pineapple
Strawberry
Watermelon
<MultiSelect
  data={['Apple', 'Banana', 'Cherry', /* … */]}
  label="Favourite fruits"
  placeholder="Pick some fruits…"
/>

Initial values

Pass a value array to pre-select options.

TypeScript
CSS
JavaScript
Rust
Go
Python
SQL
HTML
<MultiSelect
  data={skills}
  label="Skills"
  value={['ts', 'css']}
/>

Max values

Use maxValues to cap the number of selections. The search input hides once the limit is reached.

Apple
Banana
Cherry
Grape
Kiwi
Mango
Orange
Peach
Pear
Pineapple
Strawberry
Watermelon
<MultiSelect data={fruits} label="Pick up to 3" maxValues={3} />

Description and error

Select all that apply.

TypeScript
JavaScript
Rust
Go
Python
CSS
SQL
HTML
TypeScript
JavaScript
Rust
Go
Python
CSS
SQL
HTML

Please select at least one skill.

<MultiSelect label="Skills" description="Select all that apply." />
<MultiSelect label="Skills" error="Please select at least one skill." />

Disabled

Apple
Mango
Banana
Cherry
Grape
Kiwi
Orange
Peach
Pear
Pineapple
Strawberry
Watermelon
<MultiSelect data={fruits} value={['Apple', 'Mango']} disabled />

Keyboard behaviour

  • Type — filters the option list
  • ↑ / ↓ — moves keyboard focus through options
  • Enter — adds the focused option
  • Backspace (empty input) — removes the last pill
  • Escape — closes the dropdown

Props

PropTypeDefaultDescription
datastring[] | Option[][]Available option list
valuestring[][]Initially selected values
placeholderstring'Select values…'Placeholder shown when nothing is selected
maxValuesnumberMaximum number of selections allowed
labelstringField label
descriptionstringHelper text below the label
errorstring | booleanError message or highlight flag
disabledbooleanfalsePrevents interaction
nothingFoundstring'Nothing found'Message when no options match
namestringHidden input name prefix — values submitted as name[]