# Select

> Choose one option from a list. The popup aligns the selected item over the trigger, as macOS does.

Category: Selection · Atomic level: molecule · Built on Base UI Select
Page: https://ui.dtheo.dev/docs/components/select

## Install

```bash
npx dtheo@latest add select
# or, with the shadcn CLI
npx shadcn@latest add https://ui.dtheo.dev/r/select.json
```

Dependencies: @base-ui/react, clsx, tailwind-merge, lucide-react. Registry dependencies: utils, input.

## Exports

`Select`, `SelectTrigger`, `SelectValue`, `SelectContent`, `SelectItem`, `SelectGroup`, `SelectGroupLabel`, `SelectSeparator`

## Use it for

- 5 to ~15 options that need no search

## Reach for something else

- Long or searchable lists: use Combobox
- 2 to 4 options: use a segmented control or radio group

## Keyboard

| Keys | Action |
| --- | --- |
| Enter / Space / Arrow down | Opens the list |
| Arrow keys | Move the highlight |
| Type a letter | Jumps to the matching option |
| Escape | Closes without changing the value |

## Accessibility

- Exactly one chevron, in the icon slot. The checkmark marks the selected item in its own column.

## Examples

### select

```tsx
import { Field, FieldDescription, FieldLabel } from '@/components/ui/field';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';

const profiles = [
  { value: 'nominal', label: 'Nominal step' },
  { value: 'high-gain', label: 'High-gain step' },
  { value: 'damped', label: 'Damped step' },
  { value: 'fast-rise', label: 'Fast rise' },
  { value: 'thermal-soak', label: 'Thermal soak, 20 min' },
];

export default function SelectExample() {
  return (
    <Field className="w-64">
      <FieldLabel>Test profile</FieldLabel>
      <Select items={profiles} defaultValue="high-gain">
        <SelectTrigger>
          <SelectValue placeholder="Choose a profile" />
        </SelectTrigger>
        <SelectContent>
          {profiles.map((p) => (
            <SelectItem key={p.value} value={p.value}>
              {p.label}
            </SelectItem>
          ))}
        </SelectContent>
      </Select>
      <FieldDescription>The command the bench applies to the actuator.</FieldDescription>
    </Field>
  );
}
```

## Used in

- Run review (page): https://ui.dtheo.dev/examples/run-review
- Motor map (page): https://ui.dtheo.dev/examples/motor-map
- Data table pattern (template): https://ui.dtheo.dev/docs/patterns/data-table
- Forms pattern (template): https://ui.dtheo.dev/docs/patterns/forms
- Combobox (molecule): https://ui.dtheo.dev/docs/components/combobox
- Menu (molecule): https://ui.dtheo.dev/docs/components/menu
