---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Multi select

A field holding several values picked from a fixed list, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `MultiSelect`.

## Try it

In the form look, pick and unpick labels (the list stays open), at most three: then the rest turn unavailable and the search counts “3 of 3”, and the field folds the third into “+1”. Search them, remove one with its cross or Backspace, clear them all; Save with none is refused. The people list loads after a pause; pick several and their tags wrap, a long name cut; Save shows what the form sends. The beside look sets two multi-selects under a select. The chips look is a create dialog’s row of property chips: dashed while empty, the areas chip folded to its colour marks with a tooltip naming them; type a label the labels chip lacks and Enter on “Create …” makes it. Each look’s line names the list that is open.

The people arrive on a timer; a label made from the chip lives in the page only. The multi-select has no loading state of its own: the example disables the field and says "Loading…" while they come.

## When to use

- A field holding several values picked from a fixed list.
- Also called: multiple select.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Multi select on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-multi-select.json --yes
```

```text
Add the Goop Multi select to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { useState } from 'react';
import { Field } from '@/components/ui/goop/field';
import { FieldInvalid } from '@/components/ui/goop/field-error';
import { MultiSelect, MultiSelectGroup, MultiSelectItem } from '@/components/ui/goop/multi-select';

function SurveyLabels() {
  const [labels, setLabels] = useState<string[]>(['bug']);
  return (
    <Field label="Labels" orientation="vertical" className="w-full">
      <FieldInvalid error={labels.length === 0 ? 'Pick at least one label.' : undefined}>
        <MultiSelect
          name="labels"
          value={labels}
          onValueChange={setLabels}
          placeholder="Add labels"
          searchPlaceholder="Find a label…"
          empty="No label matches"
          maxShown={3}
          max={5}
        >
          <MultiSelectGroup heading="Type">
            <MultiSelectItem value="bug">Bug</MultiSelectItem>
            <MultiSelectItem value="feature">Feature</MultiSelectItem>
          </MultiSelectGroup>
          <MultiSelectGroup heading="Area">
            <MultiSelectItem value="design">Design</MultiSelectItem>
            <MultiSelectItem value="docs">Docs</MultiSelectItem>
          </MultiSelectGroup>
        </MultiSelect>
      </FieldInvalid>
    </Field>
  );
}
```

- Fits: flow, record, settings: field.
- Also known as: MultiCombobox, TagSelect, ChipsSelect, TokenField.
- It fills its column: in a form, a vertical `Field` (as wide as its column, 40 px as the select there); in a settings row, the row's `stack="always"`, which puts it under the row's words across the row. Put a `FieldInvalid` between the field and it for an error line.
- height, width, padding, gap, corner, border, background, text, motion: add no class for these.

## API reference

### Parts

- `MultiSelectItem` — One option of the list; its props: multi-select--item.md
- `MultiSelectGroup` — A group of the list's options under its `heading` (the select's group: 12 px semibold words in the muted grey)

- data-slot values (to select a part by): multi-select, multi-select-action, multi-select-badge, multi-select-chip-content, multi-select-chip-words, multi-select-count, multi-select-error, multi-select-icon, multi-select-input, multi-select-list, multi-select-text, multi-select-trigger, multi-select-value, multi-select-value-close

### MultiSelectItem

One option of the list.

```tsx
import { MultiSelectItem } from '@/components/ui/goop/multi-select';
```

### Options

- value: string — The value it adds to the field's list.
- Also takes: disabled?: boolean; keywords?: string[]; icon?: IconName; mark?: ReactNode; action?: ReactNode

### MultiSelect: every option

```tsx
import { MultiSelect } from '@/components/ui/goop/multi-select';
```

### Options

- ref?: Ref<HTMLDivElement | HTMLButtonElement>
- value?: string[]
- defaultValue?: string[]
- onValueChange?: (values: string[]) => void
- open?: boolean
- defaultOpen?: boolean = false
- onOpenChange?: (open: boolean) => void
- placeholder?: string
- searchPlaceholder?: string
- empty?: ReactNode
- maxShown?: number
- max?: number
- countLabel?: (count: number, max: number) => string
- more?: (count: number) => string
- clearLabel?: string = 'Clear all'
- removeLabel?: (words: string) => string
- chosenLabel?: (words: readonly string[]) => string
- name?: string
- size?: 'sm' | 'md' = 'md'
- shape?: 'field' | 'chip' = 'field'
- variant?: 'default' | 'ghost' = 'default'
- renderValue?: (values: readonly string[]) => ReactNode
- label?: string
- icon?: IconName
- iconOnly?: boolean | 'narrow' = false
- noneLabel?: string = 'none'
- optional?: boolean = false
- noneRowLabel?: string
- onCreate?: (words: string) => string | undefined | PromiseLike<string | undefined>
- createLabel?: (words: string) => string
- creatingLabel?: (words: string) => string
- disabled?: boolean = false
- container?: HTMLElement | null
- id?: string
- aria-invalid?: boolean | 'true' | 'false'
- children?: ReactNode
- State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-state=open, data-invalid

Shortened to fit; what went is in agent/ship/manifest.json.

## Keyboard

- Enter / Space / ArrowDown: open the list from the opener, the focus in its search field
- ArrowDown / ArrowUp: move the active row in the list
- ArrowDown / ArrowUp at max: also reach the rows unavailable at the most (said unavailable, described by the count); Enter on one picks nothing
- Enter: add or remove the active row's value; the list stays open
- Backspace: in an empty search field, remove the last value
- Escape: close the list; the focus returns to the opener
- Enter / Space on a tag's cross: remove that value; the focus moves to the next cross, else the previous, else the opener

## Accessibility

- The native element answers the keyboard.
- hover: the browser's own (:hover): write nothing
- focus-visible: the attribute data-focus-visible
- expanded: the attribute data-state=open
- open: the attribute data-state=open
- disabled: the prop disabled
- invalid: the attribute data-invalid

## Motion

- The part sets its own motion: add no transition or animation of your own.

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Field](/themes/meadow/components/field): A form row that ties one control to its label and its description, as a settings row or a stacked form field.
- [Field error](/themes/meadow/components/field-error): The error line under a form control whose value was refused, saying what to fix, inside the control's Field.
- [Person select](/themes/meadow/components/person-select): A person picker for an assignee, an owner, reviewers or guests, each person shown with their avatar beside their name.
- [Tags input](/themes/meadow/components/tags-input): A field a person types several short values into, each one a removable tag — labels, keywords, the emails to invite.
