Select
Root of the select — an accessible listbox built on Radix that owns open
state and the chosen value; drive it with value/onValueChange
(controlled) or defaultValue (uncontrolled).
Usage
@desk/ui/components/select
<Field className="w-72">
<FieldLabel htmlFor="finish">Surface finish</FieldLabel>
<FieldContent>
<Select defaultValue="honed">
<SelectTrigger id="finish">
<SelectValue placeholder="Select a finish" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Natural</SelectLabel>
<SelectItem value="matte">Matte</SelectItem>
<SelectItem value="honed">Honed</SelectItem>
<SelectItem value="brushed">Brushed</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Reflective</SelectLabel>
<SelectItem value="satin">Satin</SelectItem>
<SelectItem value="polished">Polished</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
<FieldDescription>Affects lead time and price.</FieldDescription>
</FieldContent>
</Field>Best practices
Selectis only the state root — composeSelectTrigger,SelectValue,SelectContent, andSelectItems inside it or nothing renders.Use
Selectto pick one option from a short closed list; when users need type-to-filter, useComboboxinstead.Drive it with
value+onValueChange(controlled) ordefaultValue(uncontrolled), and give it an accessible name via the trigger (Field/Label).
Props
Select
| Prop | Type | Default | Description |
|---|---|---|---|
| testId | string |
SelectContent
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | ||
| testId | string |
SelectGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| testId | string |
SelectItem
| Prop | Type | Default | Description |
|---|---|---|---|
| testId | string |
SelectLabel
| Prop | Type | Default | Description |
|---|---|---|---|
| testId | string |
SelectSeparator
| Prop | Type | Default | Description |
|---|---|---|---|
| testId | string |
SelectTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | "neutral" | "brand" | "danger" | null | undefined | ||
| radius | "rounded" | "square" | "full" | null | undefined | ||
| emphasis | "link" | "outline" | "solid" | "ghost" | "soft" | "transparent" | null | undefined | ||
| pressed | boolean | null | undefined | ||
| size | ResponsiveSize | "xl" | Trigger size — a single token or a per-breakpoint object like
|
| testId | string |
SelectValue
| Prop | Type | Default | Description |
|---|---|---|---|
| testId | string |
Also exports
- const
selectAnatomy
Anatomy
Select
selectDropdown selection input
SelectTrigger
select-triggerButton showing current value
SelectValue
select-valueDisplayed selected value
SelectContent
select-contentDropdown options container
SelectGroup
select-groupGrouped options
SelectLabel
select-labelGroup label
SelectItem
select-itemSelectable option
SelectSeparator
select-separatorVisual divider
Composition
Used by