Skip to content
GitHub (opens in a new tab)

Select

Choose one or several options from a list.

stableMoleculecontracts/select.json

Preview

Select

Choose from a list. Field trigger, kit DropdownMenu panel. multiple for several values. searchable for a long fixed list. Not a native select.

Master

A medium Select with a placeholder until you pick a fruit. Multiple, tags, checkboxes, and search are variants.

Usage

Wrap with Field. Use multiple for several values in a menu. searchable for a long fixed list. Typed or async search is Combobox. Tags with an inline filter are MultiSelect. Do not invent SelectTrigger or SelectContent.

Do's

  • Choosing one value in a Field
  • Choosing several values from a list (multiple)
  • A long fixed list with local search (searchable)
  • Short fixed lists such as month, year, timezone, or tags
  • Choosing a person (option avatar, email as description) or a status (option dot with the status word as label)

Don'ts

  • Command palettes — use Command
  • Actions from a button — use DropdownMenu
  • Mutually exclusive choices with visible options — prefer RadioGroup
  • Typed or async search — use Combobox
  • Removable tags with an inline filter — use MultiSelect
  • Tags the person types — use TagInput
<Field label="Fruit" htmlFor="fruit">
  <Select
    id="fruit"
    placeholder="Select a fruit"
    options={fruits}
  />
</Field>

Choose one or several options from a list. Field trigger, kit DropdownMenu panel. Not a native select.

When to use

  • Choosing one value in a Field
  • Choosing several values from a list (multiple)
  • A long fixed list with local search (searchable)
  • Short fixed lists such as month, year, timezone, or tags
  • Choosing a person (option avatar, email as description) or a status (option dot with the status word as label)

When not to use

  • Command palettes — use Command
  • Actions from a button — use DropdownMenu
  • Mutually exclusive choices with visible options — prefer RadioGroup
  • Typed or async search — use Combobox
  • Removable tags with an inline filter — use MultiSelect
  • Tags the person types — use TagInput

What an agent reads

import { Select } from "agentic-ds-kit";
must
  • error shows the danger border and Field's error text via aria-describedby; no aria-invalid on the trigger button (button does not support it)
  • Trigger is a field-styled button with aria-haspopup=menu
  • Must have associated label via Field or ariaLabel
  • Each option needs a human-readable label
  • Selected options show a Check, or kit Checkbox when itemCheck=checkbox
  • Overflow count is kit Badge on the trigger
  • valueDisplay=tags: Tags are siblings of the trigger button, never inside it (no nested buttons). Each Tag remove is its own button labelled Remove {label}
  • valueDisplay=tags: Tab order is each Tag remove button, then the trigger. Removing a Tag moves focus to the next remove button, or the trigger after the last one. Backspace does not remove Tags
  • Option avatar, dot and icon are aria-hidden on the row and the trigger; the label names the option. A presence word joins the name as hidden text
  • When not multiple, the picked option's avatar, dot or icon leads the trigger label. multiple with valueDisplay=text shows no leading mark
  • valueDisplay=tags: each Tag's avatar or dot is aria-hidden; the Tag label names the option. No presence word is added on Tags
  • Search and typeahead match the label only
defaults
  • size md
  • disabled false
  • error false
  • multiple false
  • itemCheck check
  • valueDisplay text
  • searchable false
stops if
  • Do not use a native select
  • Do not use kit Button as the Select trigger — Select uses DropdownMenu triggerStyle=field
  • Do not invent SelectTrigger, SelectContent, SelectItem, SelectValue, or SelectGroup
  • Do not invent a local overflow chip — overflow count is kit Badge
  • Do not render Tags inside the trigger button or add a local chip list — use valueDisplay=tags
  • Do not use raw hex
  • Do not use for navigation — use SideNav (product), DocsNav (docs/catalog) or links
  • Do not add an icon to every option only for decoration
  • Do not show a status by dot alone — the label says it

From contracts/select.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
describedBystringNo—Id(s) for aria-describedby on the trigger button. Field passes its hint or error id.
idstringYes——
sizemd | sm | lgNomdHeights match Input and Button: sm 32, md 36, lg 40. Use one size per row; lg for forms below 480px.
optionsarrayYes——
disabledbooleanNofalse—
errorbooleanNofalse—
multiplebooleanNofalseSeveral values. Menu stays open. Checks each pick. Trigger lists labels. A field of tags with an inline filter is MultiSelect.
placeholderstringNo—Shown until a value is picked. Muted field text. When set and no defaultValue, start empty.
defaultValuestring | string[]No—string when single, string[] when multiple
valuestring | string[]No—controlled
onChangefunctionNo—(value: string | string[]) => void
namestringNo——
ariaLabelstringNo—When there is no Field label, such as a DataTable Cell.
itemCheckcheck | checkboxNocheckcheckbox composes kit Checkbox in the menu when multiple. Visual only. Not DropdownMenuCheckboxItem.
maxVisiblenumberNo—When multiple and selected count exceeds this, the trigger shows the first labels (or Tags) plus a kit Badge +N. Omit to show all.
valueDisplaytext | tagsNotextmultiple only. text lists labels in the trigger. tags shows each pick as a removable kit Tag (sm Select: Tag sm; md: Tag md) that wraps onto more lines. Removing a Tag deselects that value without opening the menu. maxVisible still caps Tags with the +N Badge. Each Tag leads with the option's avatar (named by label; presence, shape and initials stay on the rows) or dot; avatar wins. Option icon is not shown on Tags.
searchablebooleanNofalseKit Input at the top of the panel. Filters option labels. For a long fixed list. Not Command.
  • Component
    →

    Command

    Searchable command menu for quick actions.

  • Component
    →

    DropdownMenu

    Actions or value menu from a button, field, or nav trigger.

  • Component
    →

    RadioGroup

    Choose exactly one option from a small visible set.

  • Component
    →

    Combobox

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