Select
Base UIA ruled dropdown for choosing from a short list.
Install
$ npx shadcn@latest add https://spotcheckui.com/r/select.jsonAlso installs @base-ui/react.
Usage
import { Select } from "@/components/spotcheck/select"
<Select
label="Model"
options={[{ value: "atlas-l", label: "atlas-l" }, { value: "atlas-m", label: "atlas-m" }]}
value={model}
onValueChange={setModel}
/>Props
- label
stringDefault —Names the control for screen readers, unless it sits inside a Field. - options * Required
SelectOption[]Default — - value
stringDefault —The selected value, when you control it. - defaultValue
stringDefault —The starting value, when it manages itself. - onValueChange
(value: string) => voidDefault — - placeholder
stringDefault Choose - className
stringDefault —
Keyboard
| Space | Open the list |
|---|---|
| ↑ ↓ | Move through options |
| Enter | Choose an option |
| Esc | Close without changing |
Reduced motion
The list appears without animation.