Primitives
Select
Dropdown for choosing a single value from a list; supports grouped options
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 | Required: the trigger is a combobox, which gets no accessible name from its content — without this, screen readers announce an unnamed control. |
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 aria-labelis a required prop — the trigger is acombobox, which gets no accessible name from its content, so an unnamed control is unshippable by type- Keyboard:
Space/Enter/ArrowDownopens; arrow keys navigate;Enterselects;Escapecloses - Focus returns to trigger on close (Radix default)