npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-multi-select.json --yesMulti select
ProA field holding several values picked from a fixed list, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- MultiSelectItemOne option of the list
- MultiSelectGroupA group of the list's options under its
heading(the select's group: 12 px semibold words in the muted grey)
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>
);
}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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-multi-select.json --yesAdd the Goop Multi select to this project. The install steps are at https://goop.so/docs/install.mdUsage
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'sstack="always", which puts it under the row's words across the row. Put aFieldInvalidbetween the field and it for an error line. - height, width, padding, gap, corner, border, background, text, motion: add no class for these.
API reference
- Each option with its sentence: multi-select--options.md
- State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-state=open, data-invalid
| Part | What it is |
|---|---|
| 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.
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
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
| Key | What it does |
|---|---|
| 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
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| 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.