Select

A select dropdown component.

Use Field to compose a label, helper text, and validation message around this control.

Usage

Composition

Use Field and FieldLabel for the control's label. Use SelectLabel inside SelectGroup for option-group headings.

Field label

Connect FieldLabel to SelectTrigger with matching htmlFor and id values.

Invalid

Set data-invalid on Field and aria-invalid on SelectTrigger. Connect validation messages with aria-describedby.

Choose a fruit.

Size

Appearance

Disabled

Props

PropTypeDefaultDescription
valuestring-The controlled value
defaultValuestring-The default selected value
onValueChange(value: string | null, eventDetails) => void-Callback when the value changes
itemsRecord<string, ReactNode> | { value: string; label: ReactNode }[]-Labels shown in the trigger for each value (SelectValue renders the raw value without it)
size'sm' | 'md' | 'lg''md'Size of the select
appearance'secondary' | 'ghost''secondary'Visual style of the trigger (for SelectTrigger)
disabledbooleanfalseWhether the select is disabled
alignItemWithTriggerbooleanfalseWhether the selected item overlaps and lines up with the trigger (for SelectContent). Opens outside the trigger by default