Forms
Select
Native drop-down in the field style, for one choice out of many options.
- Experimental
- Keyboard tested
- Screen reader not tested yet
Playground
Change the props. The controls come from the documented props.
<Select
label="Budget"
name="playground-budget"
placeholder="Choose a range"
options={[
{ value: "small", label: "Up to 20k" },
{ value: "large", label: "20k and more" },
]}
/>States
Every variant in every state, side by side. Hover, pressed and focus are shown statically; the default state is interactive.
Error: Choose a project type.
Usage
When to use
Use a select for one choice out of six or more options, or when space is tight.
When not to use
- For two to five options people should compare: use RadioGroup.
- For a yes/no decision: use Checkbox.
How it works
The native select in the field style, with a chevron from the tokens. Keyboard, screen readers and phone pickers work without extra code. A placeholder adds an empty first option (“Choose a project type”), which makes required meaningful.
Content guidelines
The label names the thing chosen. Options are short and parallel. Write the placeholder as an instruction that names the thing: “Choose a project type”.
Do and don’t
Do
- Use it for six or more options, or when space is tight.
Don’t
- Don't use it for two to five options people should compare; use RadioGroup.
Anatomy
The parts of the component and what each one does, as in the playground above.
- labelAlways visible.
- input-fieldNative select, 48px, border.control.
- iconChevron, decorative.
- optionRendered by the operating system's picker.
Examples
Type-checked, and the same code goes into the AI manifest. Import: import { Select } from "@/ds";
With placeholder option
Optional with default
Props
Checked against the component's TypeScript type on every build.
| Name | Type | Default | Description |
|---|---|---|---|
| label (required) | string | – | Visible label. |
| options (required) | SelectOption[] | – | value and label per option. |
| placeholder | string | – | First empty option, e.g. “Choose a project type”. With required, leaving it fails validation. |
| hint | string | – | Help text between label and field. |
| error | string | – | Error message; overrides native validation. |
| optional | boolean | false | Adds “(optional)” to the label. |
| messages | ValidationMessages | – | Texts for native validation inside a Form. |
| …select | SelectHTMLAttributes | – | Native attributes such as name, required, defaultValue. |
Tokens used
Derived from the utility classes in the component's source. Copy a class with one click.
| Token | Tier | Value | Utility |
|---|---|---|---|
| input.height | component | 48px | |
| select.chevron | component | #555555 | |
| spacing.12 | semantic | 48px | |
| spacing.4 | semantic | 16px |
Accessibility
What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
| Check | How | Status |
|---|---|---|
| axe-core rules | Automated on every npm run check, at desktop and mobile width | Runs on every build |
| Keyboard | Automated Playwright test (scripts/keyboard.mjs) | Tested |
| Screen reader | Manual | Not tested yet |
Keyboard
| Key | Action |
|---|---|
| Tab | Moves focus to the select. |
| Arrow up / down | Changes the option. |
| Space / Alt + Arrow down | Opens the option list. |
Semantics and focus
- Native <select>: keyboard, screen readers and mobile pickers work without extra code.
- Label, hint and error come from Field.