Skip to content
GitHub (opens in a new tab)

MultiSelect

Choose several values. Selected values stay in the field as removable tags, and typing filters the list.

stableMoleculecontracts/multiselect.json

Preview

MultiSelect

Several values stay in the field as removable tags. Typing filters the list. A short menu of choices is still Select multiple.

Master

Enter toggles the highlighted option. Backspace on an empty query removes the last tag.

DesignProduct

Usage

Wrap with Field. Tags are kit Tag. Overflow +N is kit Count. Tags the person types, rather than picks, are TagInput.

Do's

  • Several values from a list, shown as tags in the field
  • The list is long enough that the person filters it while choosing

Don'ts

<Field label="Teams" htmlFor="teams"><MultiSelect id="teams" options={teams} /></Field>

When to use

  • Several values from a list, shown as tags in the field
  • The list is long enough that the person filters it while choosing

When not to use

  • One value — use Select or Combobox
  • A short list in a menu — use Select multiple
  • Tags the person types — use TagInput

What an agent reads

import { MultiSelect } from "agentic-ds-kit";
must
  • Escape closes only this panel, not a parent Modal, Drawer or AlertDialog
  • The filter input is role=combobox. The popup is role=listbox aria-multiselectable=true
  • Each option is role=option with aria-selected. Enter toggles the active option. The list stays open
  • Backspace on an empty query removes the last tag. Each tag remove button removes that value
  • One trailing chevron button, named Show options or Hide options, opens and closes the list
  • Escape closes and returns focus to the input
  • Must have a Field label or ariaLabel
  • Highlight: the fill is one decorative layer (aria-hidden) that glides to the active option on hover and arrow keys (clip-path only, --motion-expand-*); it lands in place on first show, after the pointer leaves and on resize or scroll, and jumps with no slide under prefers-reduced-motion. Roles, aria-selected, aria-activedescendant and focus order are unchanged and the focus ring stays on the row
defaults
  • size md
  • placeholder Select
  • disabled false
  • error false
  • emptyLabel No results
stops if
  • Do not invent a local chip list — selected values are kit Tag
  • Do not invent an overflow chip or use Badge for it — the overflow count is kit Count
  • Do not use Select valueDisplay=tags when the filter must live in the field
  • Do not use raw hex

From contracts/multiselect.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
idstringYes——
sizemd | sm | lgNomdHeights 32 / 36 / 40 on one row; wrapped tags grow it.
optionsarrayYes——
valuestring[]No——
defaultValuestring[]No——
onChangefunctionNo—(value: string[]) => void
placeholderstringNoSelect—
disabledbooleanNofalse—
errorbooleanNofalse—
maxVisiblenumberNo—Extra selections collapse into a kit Count +N (prefix +, neutral, subtle, md) after the visible Tags; screen readers hear N more selected (KitLabels moreSelected).
namestringNo—Hidden input joins values with commas.
ariaLabelstringNo——
describedBystringNo——
emptyLabelstringNoNo results—
  • Component
    →

    Select

    Choose one or several options from a list.

  • Component
    →

    Combobox

    Type to filter one value, including a list the parent loads asynchronously.

  • Component
    →

    TagInput

    Tags the person types.

  • Component
    →

    TaskBrief

    The brief a person hands an agent before it plans: a goal, one-line "done when" checks, optional spend, time and step limits, allowed tools, model and check-in level.