# Multi Select

> Pick several values from one field. Picks show as removable chips that fold into a "+N" chip when they run out of room, with a clear button in the trigger. Checkbox rows stay open while you toggle them, groups and descriptions carry over from Select, and a footer offers Select all and Clear. An optional max disables the rest once it's reached.

- Slug: `multi-select`
- Category: [Selects](https://www.assembli.design/category/selects.md)
- Type: component
- Tags: multi-select, select, chips, checkbox, listbox, keyboard
- npm dependencies: @base-ui/react, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/multi-select
- Page: https://www.assembli.design/components/multi-select

![Multi Select preview](https://www.assembli.design/thumbnails/multi-select-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `options` (required) | `(SelectOption \| SelectOptionGroup)[]` |  | Options, groups of options, or a mix. Consecutive loose options share an unlabelled group. |
| `value` | `string[]` |  |  |
| `defaultValue` | `string[]` | `[]` |  |
| `onValueChange` | `(value: string[]) => void` |  |  |
| `label` | `React.ReactNode` |  |  |
| `hint` | `React.ReactNode` |  | Quiet text to the right of the label, such as "Optional". |
| `description` | `React.ReactNode` |  |  |
| `error` | `React.ReactNode` |  | Replaces the description and marks the trigger `aria-invalid`. |
| `placeholder` | `React.ReactNode` | `"Select…"` |  |
| `leading` | `React.ReactNode` |  | A field icon before the chips. |
| `size` | `SelectSize` | `"md"` |  |
| `max` | `number` |  | The most options that can be picked. The rest disable once it's reached. |
| `footer` | `boolean` | `true` | Shows the "Select all" and "Clear" footer in the popup. Defaults to `true`. |
| `clearable` | `boolean` | `true` | Shows the clear button in the trigger once something is picked. Defaults to `true`. |
| `disabled` | `boolean` |  |  |
| `required` | `boolean` |  |  |
| `name` | `string` |  | Submits every picked value under this name with a surrounding form. |
| `open` | `boolean` |  |  |
| `defaultOpen` | `boolean` |  |  |
| `onOpenChange` | `(open: boolean) => void` |  |  |
| `modal` | `boolean` |  | Locks page scroll and outside clicks while open. Defaults to `true`. |
| `triggerClassName` | `string` |  | Classes for the trigger; `className` goes on the root. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/multi-select/multi-select.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/multi-select
```

Registry item JSON: https://www.assembli.design/r/multi-select.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
