Multi-select
ProNewChoose several options: chips inside the field, a text input that filters the list, and checkmarks that stay open.
Installation
pnpm dlx shadcn@latest add @viewport/multi-select
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| options* | MultiSelectOption[] | — |
| value | string[] | — |
| defaultValue | string[] | [] |
| onValueChange | (value: string[]) => void | — |
| placeholder | stringShown while nothing is selected and nothing is typed. | "Select…" |
| emptyText | stringShown when the search matches nothing. | "No results" |
Accessibility
- Focus never leaves the input; Enter toggles the highlighted option.
- Backspace on an empty input removes the last chip, and every chip has a labelled remove button.
- Each addition and removal is announced.
- Respects prefers-reduced-motion.