Brand Guide

Components

Select

Picks one answer from a short, fixed list, such as a notice period.

Default

The list opens under the trigger, at least as wide. The chosen option has a tick at its end.

In a field

FieldControl wraps the trigger, so the label and the message describe the part that takes focus.

How long you have to work after you resign.

Controlled

Hold the value in state with value and onValueChange. Set it to null to clear it.

Invalid

Disabled

Read-only

The value is locked and the list stays closed. A lock takes the chevron's place.

Set by the role.

Best practices

  • Use a select for one answer from a short, fixed list, such as a notice period or a level. For more options than a short list can hold, use a combobox, which can be searched.
  • Pass items, either a map of value to label or a list of { value, label }. The trigger then shows the chosen option's label. Without it, the trigger shows the raw value.
  • A controlled select with nothing chosen has the value null, not an empty string.
  • In a field, FieldControl goes round the SelectTrigger, not the Select.
  • The list opens above dialogs and sheets on its own: its positioner sits at z-[90]. To stack it differently, pass positionerClassName to SelectContent; a z- class in className does nothing, because the positioner is what stacks.
  • A read-only select keeps its value and does not open. Give it helper text saying why.