Select
Choose from a compact list of options.
Usage
Use Select for a styled single choice. Use the HTML select element for native validation, optgroups, or multiple selection.
Accessibility
Provide a visible label. Use arrow keys to move, type to search by label, Enter to select, and Escape to dismiss.
| Property | Type | Default |
|---|---|---|
| options | readonly SelectOption[] | Required |
| value / defaultValue | string | None |
| onValueChange | (value: string) => void | None |
| name | string | None |
<div>
<label htmlFor="environment">Environment</label>
<Select
id="environment"
name="environment"
defaultValue="staging"
options={[
{ value: 'staging', label: 'Staging' },
{ value: 'preview', label: 'Preview', disabled: true },
{ value: 'production', label: 'Production' },
]}
/>
</div>