Multi select
A field that holds several options from a known list, shown as chips: alert channels, regions, teams. Type to filter and keep picking; the list stays open. For free text that is not in a list use the tags input; for a few options always on view, a checkbox group.
Install
npx shadcn@latest add @thrum-pro/multi-selectThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Automatically installs icons check and x from the icon set.
Data shape
type MultiSelectOption = { value: string; label: string; disabled?: boolean };const CHANNELS = [
{ value: "email", label: "Email" },
{ value: "sms", label: "SMS", disabled: true },
{ value: "webhook", label: "Webhook" },
];Props
| Prop | Type | Default | Description |
|---|---|---|---|
options | readonly MultiSelectOption[] | Required | Every option, in order. A disabled one shows but cannot be picked. |
value | readonly string[] | – | The selected values, when the parent holds them. Use it with onValueChange. |
defaultValue | readonly string[] | Default [] | The values selected at first, when the field holds them itself. |
onValueChange | (value: string[]) => void | – | Called with the whole new list when values are added or removed. |
placeholder | string | – | Shown while nothing is selected. |
maxVisible | number | – | How many chips show before the rest collapse into +N, whose tooltip lists them. All of them by default. |
selectAll | boolean | Default true | Offer Select all and Clear at the top of the list while nothing is typed. Both leave disabled options as they are. |
emptyLabel | string | Default "No results" | The row shown when the typed text matches nothing. |
size | "sm" | "md" | "lg" | Default "md" | 28, 32 or 40 pixels tall. The field grows a row at a time as the chips wrap. |
disabled | boolean | Default false | The whole field is dimmed and cannot be used. |
name | string | – | The form field name. Each selected value is sent under it. |
id | string | – | The input's id, for a label element's htmlFor. |
aria-label | string | – | The input's name for screen readers, when there is no label element. |
sound | boolean | Default true | Play a soft sound when values are added or removed, and when the list opens or closes, if the visitor has sound on. |
className | string | – | Classes for the field. It fills its container by default. |
Motion and sound
Motion
- The list fades in and grows from 96% to full size over 150 ms, from the edge that touches the field, and plays it backwards to close.
- Chips appear and leave in one frame. Reduced motion: the list appears and leaves at once.
Sound
- A soft rising sound when options are added, once per pick or per Select all.
- A soft falling sound when options are removed, by a chip's cross, Backspace, a second pick or Clear.
- A soft rising tone when the list opens and a falling one when it closes.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- It follows the WAI-ARIA combobox pattern with a multi-selectable listbox: the input controls the list and the highlighted option is announced while the focus stays in the text.
- The input needs a name: a label element with htmlFor and id, or an aria-label.
- Selected options carry a tick as well as aria-selected. Each chip is named by its option, and its cross by Remove and the option.
- The +N chip reads as 3 more selected, and its tooltip lists them.
- A long label is cut in its chip, with the full text in a tooltip, and wraps in the list. The field wraps chips onto new rows at 160 pixels wide.
- Under a glass material the list is translucent. Its tint keeps the text at 4.5 to 1 over any page.
| Keys | Action |
|---|---|
| Type | Filter the list. Select all and Clear hide while there is text. |
| ↓ / ↑ | Open the list, then move the highlight. Disabled options are skipped. |
| Enter | Add the highlighted option, or remove it when it is already selected. The list stays open. |
| Backspace | In the empty field: remove the last selected option. |
| ← / → | From the start of the field, move onto the chips and between them. |
| Backspace / Delete | On a chip: remove it. |
| Esc | Close the list. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/multi-select.tsx- Packages
@base-ui/react@1.9.0- Brings along
- Sound engineCombobox
- Icons
checkx
Changelog
- 1.0.0 · 2026-12-03First release.