Select

Selects let users choose a single option from a list anchored to a trigger.

The Select component is a Base UI component.

Groups

Use SelectGroup with a SelectGroupLabel to label related options, and SelectSeparator to divide sections.

Icons

Options can include an icon before their label and a supporting description. Use the whole option object as the SelectItem value, and pass a render function to SelectValue so the trigger can render the selected option the same way. Provide itemToStringValue on Select to convert the object to a string for form submission, and set label on SelectItem for keyboard text navigation.

Size

The SelectTrigger comes with 5 sizes: 32, 36, 40 (default), 44, and 48.

Rounded

Use the rounded prop to give the trigger fully rounded corners.

Disabled

Use the disabled prop on SelectItem to prevent a single option from being selected, or the disabled prop on Select to disable the entire control.

State

By default, Select is an uncontrolled component that manages its own state. Use the defaultValue prop to set the initially selected option.

<Select defaultValue="sans">
<SelectTrigger>
<SelectValue placeholder="Select a font" />
</SelectTrigger>
<SelectContent>
<SelectItem value="sans">Sans-serif</SelectItem>
<SelectItem value="serif">Serif</SelectItem>
</SelectContent>
</Select>

Use value and onValueChange props if you need to access or control the state.

const [font, setFont] = useState(null)
return (
<Select onValueChange={setFont} value={font}>
<SelectTrigger>
<SelectValue placeholder="Select a font" />
</SelectTrigger>
<SelectContent>
<SelectItem value="sans">Sans-serif</SelectItem>
<SelectItem value="serif">Serif</SelectItem>
</SelectContent>
</Select>
)