Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-multi-select.json --yes

Multi select

Pro

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

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.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-multi-select.json --yes
PROMPT
Add the Goop Multi select to this project. The install steps are at https://goop.so/docs/install.md

Usage

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

function IssueLabels() {
  const [labels, setLabels] = useState<string[]>(['bug']);
  const [areas, setAreas] = useState(['Design', 'API', 'Docs']);
  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}
          onCreate={async (words) => {
            await new Promise((done) => setTimeout(done, 800)); // your server's save
            setAreas((all) => [...all, words]);
            return words;
          }}
        >
          <MultiSelectGroup heading="Type">
            <MultiSelectItem value="bug">Bug</MultiSelectItem>
            <MultiSelectItem value="feature">Feature</MultiSelectItem>
            <MultiSelectItem value="chore">Chore</MultiSelectItem>
          </MultiSelectGroup>
          <MultiSelectGroup heading="Area">
            {areas.map((area) => <MultiSelectItem key={area} value={area}>{area}</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); in a list of settings rows, the row's stack="always", which puts it under the row's words across the row, inside the row's inset and hairline (beside the words a plain row holds it to a text field's 180 px). Put a FieldInvalid between the field and it for an error line.
  • height, width, padding, gap, corner, border, background, shadow, 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-state=open, data-disabled, data-placeholder
Parts
PartWhat it is
MultiSelectItemOne option of the list
MultiSelectGroupA group of the list's options under its heading (the select's group: 12 px words at 500 in the grey)
  • data-slot values (to select a part by): multi-select, multi-select-action, multi-select-badge, 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, property-chip-content, property-chip-words

MultiSelectGroup

A group of the list's options under its heading (the select's group: 12 px words at 500 in the grey).

TSX
import { MultiSelectGroup } from '@/components/ui/goop/multi-select';

Options

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

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-state=open, data-disabled, data-placeholder

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

Keyboard

KeyWhat it does
Enter Space ArrowDownOpen the list from the opener, the focus in its search field
ArrowDown ArrowUpMove the active row in the list
ArrowDown / ArrowUp at maxAlso reach the rows unavailable at the most (said unavailable, described by the count); Enter on one picks nothing
EnterAdd or remove the active row's value; the list stays open
BackspaceIn an empty search field, remove the last value
EscapeClose the list; the focus returns to the opener
Enter / Space on a tag's crossRemove that value; the focus moves to the next cross, else the previous, else the opener

Accessibility

  • The native element answers the keyboard.
  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
expandedthe attribute data-state=open
openthe attribute data-state=open
disabledthe attribute data-disabled
invalidthe attribute aria-invalid
placeholder-shownthe attribute data-placeholder

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

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.

goop.so/themes/trail/components/multi-select.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-multi-select.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.