Primitives
Select
Dropdown for choosing a single value from a list; supports grouped options
Markdown version for agents · 5 stories in Storybook(opens in a new tab)
import { Select } from '@amezquita/design-system/components/primitives/Select'Live render
Props
| Prop | Type | Description |
|---|---|---|
value? | string | |
defaultValue? | string | |
onValueChange? | (value: string) => void | |
placeholder? | string | |
disabled? | boolean | |
required? | boolean | |
name? | string | |
groups | { label?: string; options: { value: string; label: string; disabled?: boolean }[] }[] | |
aria-label? | string | The trigger is a combobox, which gets no accessible name from its content. Required on its own; inside a Field, the Field's label names it and this can be left out. |
Tokens
| Token | Type | Value |
|---|---|---|
--select-item-padding-x | dimension | 16px |
--select-item-padding-y | dimension | 8px |
Usage example
<div style={{ maxWidth: '280px' }}>
<Select {...args} />
</div>Accessibility
- Trigger is a
<button>via Radix — do not wrap it in another button - The trigger is a
combobox, which gets no accessible name from its content: give it anaria-label, or put it in aField(a dev warning fires when it has neither). In a Field with anerror, the trigger getsaria-invalidand the red edge Input uses - Keyboard:
Space/Enter/ArrowDownopens; arrow keys navigate;Enterselects;Escapecloses - Focus returns to trigger on close (Radix default)