Skip to content
Browse docs and components

Select

select

A choice from a list too long for radio buttons. Grouped with labels, an inline check on the selected option, typeahead and arrow-key navigation from the Base UI select primitive, and a trigger that reads as a field rather than as a button so it sits beside inputs without looking wrong.

Responsive

Install

$npxshadcnadd@forme/select

Adds the component, its registry dependencies, and the token stylesheet you import once.

Usage

import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/forme/select/select";

<Select defaultValue="eu">
  <SelectTrigger>
    <SelectValue />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="eu">Europe</SelectItem>
    <SelectItem value="us">United States</SelectItem>
  </SelectContent>
</Select>

When to use

Reach for it

  • Picking one value from a list too long for radio buttons, such as a region, a timezone or a role.

Use something else

  • Two to five options that should all be visible; use a RadioGroup or a SegmentedControl.
  • Choosing several values; that is a MultiSelect.
  • Running actions — a list of actions is a Dropdown.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

SelectTrigger

PropTypeDefaultDescription
asChildboolean—Render as the single child element instead of a <button>, keeping the trigger behaviour.

Also takes every prop of Base UI Select.Trigger.

SelectItem

PropTypeDefaultDescription
destructiveboolean—Renders destructive: for an option the reader should think twice about.

Also takes every prop of Base UI Select.Item.

The other parts

  • SelectTakes Base UI Select.Root
  • SelectValueTakes Base UI Select.Value
  • SelectContentTakes Base UI Select.Popup and Pick<ComponentProps<typeof SelectPrimitive.Positioner>, "side" | "sideOffset" | "align">
  • SelectLabelTakes Base UI Select.GroupLabel
  • SelectGroupTakes Base UI Select.Group

Accessibility

  • Base UI gives it the listbox pattern: typeahead, arrow keys, Home and End, and Esc to close.

Motion

  • The list grows from the trigger with a slight scale and blur, and exits faster than it enters.