Select

Picks one value from a list in a popup.

Installation

  1. Add the registryOnce per project
  2. Add select

Usage

Pass items to Select, as an object of labels keyed by value or an array of { value, label }, so SelectValue can show the selected label.

For a long list people will want to search, use a Combobox. For the platform's own picker, use a Native Select.

Composition

Examples

With a label

A FieldLabel in the same Field names the trigger. Without one, give the trigger an aria-label.

Used for emails and the interface.

Groups

Use SelectGroup, SelectLabel and SelectSeparator.

Custom item content

Items can hold more than text. Pass SelectValue a function to render the selected item.

Sizes

Disabled

Set disabled on Select, or on a single SelectItem.

Invalid

Set invalid on the Field and explain the problem with a FieldError.

Props

SelectContent takes side, sideOffset, align, alignOffset and alignItemWithTrigger.

The tables leave out className, style and render. Parts built on Base UI take them as its styling and composition guides describe.

Select

SelectValue

SelectTrigger

SelectContent

SelectItem

SelectSeparator

SelectScrollUpButton

SelectScrollDownButton