Select
A customizable select component for choosing from a list of options.
Installation
Install the required dependency for the Select component.
npm install @radix-ui/react-select
Basic Usage
The Select component provides a customizable dropdown menu for selecting an option.
Grouped Options
Group related options together with labels and separators.
Disabled State
A select component in its disabled state.
Props
The props you can pass to the Select component.
Prop
Type
Default
Description
value
string
undefined
The controlled value of the select
defaultValue
string
undefined
The default value of the select
onValueChange
function
undefined
Callback fired when the value changes
disabled
boolean
false
Whether the select is disabled
required
boolean
false
Whether the select is required
name
string
undefined
The name of the select when used in a form