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
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | The controlled value |
defaultValue | string | - | The default selected value |
onValueChange | (value: string | null, eventDetails) => void | - | Callback when the value changes |
items | Record<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) |
disabled | boolean | false | Whether the select is disabled |
alignItemWithTrigger | boolean | false | Whether the selected item overlaps and lines up with the trigger (for SelectContent). Opens outside the trigger by default |