Select
Terminal-style dropdown select component for choosing from a list of options.
Import
Basic Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
options* | SelectOption[] | — | Array of options to display |
value | string | — | Selected value (controlled) |
defaultValue | string | — | Default selected value (uncontrolled) |
onValueChange | (value: string) => void | — | Callback when value changes |
placeholder | string | 'Select...' | Placeholder text |
label | string | — | Label text |
disabled | boolean | false | Whether the select is disabled |
name | string | — | Name attribute for forms |
className | string | — | Additional CSS class names |
SelectOption Type
With Label
Country
Disabled State
Country (Disabled)
Disabled Options
Individual options can be disabled:
Controlled Select
Favorite Country
Selected: (none)
Features
- Built on Base UI's accessible select primitive
- Keyboard navigation (Arrow keys, Enter, Escape)
- Supports disabled state and disabled options
- Works as controlled or uncontrolled component
Keyboard Navigation
| Key | Action |
|---|---|
Space / Enter | Open dropdown / select highlighted option |
Arrow Down | Highlight next option |
Arrow Up | Highlight previous option |
Escape | Close dropdown |
Home | Highlight first option |
End | Highlight last option |
Accessibility
- Built on accessible Base UI primitives
- Proper ARIA attributes for screen readers
- Keyboard navigable
- Focus management
Styling
| Variable | Description |
|---|---|
--theme-border | Select border color |
--theme-background | Select background |
--theme-text | Select text color |
--theme-button | Option hover background |
Related Components
- ComboBox - Searchable select
- RadioGroup - For small option sets
- Input - Text input