On this page

InstallationUsageAnatomySizesWidthNothing chosenItems: an icon and a sizeGroupsDisabledIn a field, and invalidA label in the trigger, a badge on an itemLink triggersOver or beside its triggerA long listThe trigger's own textIn the dashboardAPI ReferenceSelectSelectTriggerSelectContentSelectItemThe small partsRulesOpen questionsWhich controlLabel, default and optionsThe trigger and the menuAccessibilityWhat others expose

Select

Picks one value from a list that opens over its trigger: the secondary button's look in four sizes, and a menu of items with an optional icon, in groups, the chosen one marked by its check.

1<Select defaultValue="editor">2  <SelectTrigger aria-label="Role">3    <SelectValue placeholder="Select a role" />4  </SelectTrigger>5  <SelectContent>6    <SelectItem value="admin">Admin</SelectItem>7    <SelectItem value="editor">Editor</SelectItem>8    <SelectItem value="viewer">Viewer</SelectItem>9  </SelectContent>10</Select>

Installation

text
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "@dome-systems/ds-dashboard/components";

Usage

text
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "@dome-systems/ds-dashboard/components";
text
<Select defaultValue="editor">
  <SelectTrigger aria-label="Role">
    <SelectValue placeholder="Select a role" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="admin">Admin</SelectItem>
    <SelectItem value="editor">Editor</SelectItem>
    <SelectItem value="viewer">Viewer</SelectItem>
  </SelectContent>
</Select>

The Select holds the value. The SelectTrigger is the button, with a SelectValue inside it; the SelectContent is the menu, with a SelectItem for each option. The chevron and the checks are drawn for you.

The trigger shows the chosen item's label, which the Select reads from the SelectItem elements among its children. An item drawn inside a component of your own is not seen there, and the trigger shows its raw value: write the items in place (a map or a fragment is fine), or pass the labels as items.

Anatomy

  • Trigger. The secondary button's fill, edge and hover, with the Input's focus band and invalid edge.
  • Value. The chosen item's label, after its icon if it has one, on one line. With nothing chosen, the placeholder in the muted text.
  • Chevron. The small chevron, a step quieter than the text. It doesn't turn when the menu opens.
  • Menu. The popover surface, as wide as its longest item and never narrower than the trigger. 4px of padding; corners 10 around items at 6.
  • Item. One option on one line, the rows touching. Secondary text; under the pointer or the keyboard, a muted fill and full text.
  • Check. The small check at the row's end marks the chosen item, and nothing else does.
  • Group label. Names the items under it, a size smaller, in the muted text. Not an option.
  • Separator. A 1px line between groups, edge to edge, 4px above and below.
TriggerHeightTextChevronLeft, rightCornersGap
md32pxlabel-2, 13px14px12px, 10px8px8px
sm28pxlabel-2, 13px14px10px, 8px8px6px
xs24pxlabel-3, 12px12px8px, 6px6px4px
xxs20pxlabel-4, 11px10px6px, 4px5px2px
ItemHeightTextIcon and checkLeft, rightIcon to text
md28pxbody-2, 13px14px8px, 28px8px
sm24pxbody-3, 12px12px6px, 24px6px

With an icon, the trigger's left side is 2px tighter, as the secondary button's. An item's right side holds the check. Opened over its trigger, the menu's rows take the trigger's own left and right instead, so each row sits on it.

Sizes

The trigger takes the button's four sizes: md is 32px tall (the default), sm 28, xs 24 and xxs 20, each with the button's padding, text, corners and icon size. In a card's header or footer a trigger asked for at medium renders small.

1{(["md", "sm", "xs", "xxs"] as const).map((size) => (2  <Select key={size} defaultValue="editor">3    <SelectTrigger size={size} aria-label="Role"><SelectValue /></SelectTrigger>4    <SelectContent>5      <SelectItem value="admin">Admin</SelectItem>6      <SelectItem value="editor">Editor</SelectItem>7      <SelectItem value="viewer">Viewer</SelectItem>8    </SelectContent>9  </Select>10))}

Width

hug, the default, makes the trigger as wide as its value: it changes width when the value does. fixed takes the width it is given, its container's (224px here), and the value is cut to one line. The menu is as wide as its longest item, and never narrower than the trigger.

1<div className="flex w-56 flex-col items-start gap-3">2  {(["hug", "fixed"] as const).map((width) => (3    <Select key={width} defaultValue="us-east-1">4      <SelectTrigger width={width} aria-label="Region"><SelectValue /></SelectTrigger>5      <SelectContent>6        <SelectItem value="us-east-1">us-east-1</SelectItem>7        <SelectItem value="eu-west-1">eu-west-1</SelectItem>8        <SelectItem value="ap-south-1">ap-south-1</SelectItem>9      </SelectContent>10    </Select>11  ))}12</div>

Nothing chosen

With no value, the trigger shows SelectValue's placeholder in the muted text. A placeholder is not an item: once something is chosen, the menu offers no way back to it. An item whose value is null is that way back: a choice with its own word (None), which has the check while it is chosen and shows in the trigger in the muted text. Held in your own state (value, onValueChange), a value set to null brings the placeholder back.

1<Select>2  <SelectTrigger aria-label="Model pool"><SelectValue placeholder="Select a pool" /></SelectTrigger>3  <SelectContent>4    <SelectItem value="general">General</SelectItem>5    <SelectItem value="fast">Fast</SelectItem>6  </SelectContent>7</Select>8<Select defaultValue={null}>9  <SelectTrigger aria-label="Escalation"><SelectValue /></SelectTrigger>10  <SelectContent>11    <SelectItem value={null}>None</SelectItem>12    <SelectItem value="email">Email the owner</SelectItem>13    <SelectItem value="page">Page on-call</SelectItem>14  </SelectContent>15</Select>

Items: an icon and a size

An item takes an iconStart. The trigger then shows the chosen item as the item shows itself: its icon, then its label, held as the secondary button holds an icon (that side 2px tighter). An item's size is md, 28px tall with 13px text and a 14px icon (the default), or sm, 24px with 12px text and a 12px icon. It is set on each item.

1{(["md", "sm"] as const).map((size) => (2  <Select key={size} defaultValue="hosted">3    <SelectTrigger size={size === "md" ? "md" : "xs"} aria-label="Gateway"><SelectValue /></SelectTrigger>4    <SelectContent>5      <SelectItem size={size} value="hosted" iconStart={Cloud}>Hosted</SelectItem>6      <SelectItem size={size} value="self-hosted" iconStart={Server}>Self-hosted</SelectItem>7      <SelectItem size={size} value="local" iconStart={Laptop}>Local sandbox</SelectItem>8    </SelectContent>9  </Select>10))}

Groups

A SelectGroup holds its items under a SelectLabel, in the muted text a size under the items. A SelectSeparator draws a line between groups, edge to edge. A label outside a group throws.

1<Select defaultValue="editor">2  <SelectTrigger aria-label="Role"><SelectValue /></SelectTrigger>3  <SelectContent>4    <SelectGroup>5      <SelectLabel>Built-in roles</SelectLabel>6      <SelectItem value="admin">Admin</SelectItem>7      <SelectItem value="editor">Editor</SelectItem>8      <SelectItem value="viewer">Viewer</SelectItem>9    </SelectGroup>10    <SelectSeparator />11    <SelectGroup>12      <SelectLabel>Custom roles</SelectLabel>13      <SelectItem value="auditor">Auditor</SelectItem>14      <SelectItem value="billing">Billing manager</SelectItem>15    </SelectGroup>16  </SelectContent>17</Select>

Disabled

disabled on an item dims it: the pointer passes over it and it can't be chosen. The arrow keys still stop on it. disabled on the Select dims the whole trigger, which then takes no focus and opens nothing.

1{[false, true].map((disabled) => (2  <Select key={String(disabled)} defaultValue="4" disabled={disabled}>3    <SelectTrigger aria-label="Access duration"><SelectValue /></SelectTrigger>4    <SelectContent>5      <SelectItem value="1">1 hour</SelectItem>6      <SelectItem value="4">4 hours</SelectItem>7      <SelectItem value="168" disabled>7 days</SelectItem>8    </SelectContent>9  </Select>10))}

In a field, and invalid

A Field gives the select its title, a description and an error. The title names the trigger, and a press on it focuses the trigger without opening the menu. With an error, the field marks the trigger invalid (the Input's invalid edge) and shows the message under it. Outside a Field, aria-invalid on the trigger draws the same edge. As a card's row (row), the field pads 16px around the select.

Model pool

Where this model's traffic is routed.

Choose a pool.
1<div className="w-64">2  <Field title="Model pool" description="Where this model's traffic is routed." error="Choose a pool.">3    <Select>4      <SelectTrigger width="fixed"><SelectValue placeholder="Select a pool" /></SelectTrigger>5      <SelectContent>6        <SelectItem value="general">General</SelectItem>7        <SelectItem value="fast">Fast</SelectItem>8      </SelectContent>9    </Select>10  </Field>11</div>

A label in the trigger, a badge on an item

label on the trigger says what the select is about before its value and a colon: “Type: All”. It is for a select with no field label beside it, a filter on a table's bar, where a bare “All” says nothing. The label is in the secondary text color, 4px before the value at every size, and it names the trigger for a screen reader. A trigger with a label opens its menu under it, not over it: laid over it, the menu would line its rows up with the value and cover half the label. badge on an item ends its row in a Badge (the Badge's own shape, as a menu row's), before the check's place. The badge stays in the menu: the trigger shows the label alone. No screen uses a labelled select yet: it is the Table's exposed filter, kept as an option.

1<Select defaultValue="all">2  <SelectTrigger size="sm" label="Type"><SelectValue /></SelectTrigger>3  <SelectContent align="end">4    <SelectItem value="all">All</SelectItem>5    <SelectItem value="managed" badge={{ label: "Preview", color: "info" }}>Managed</SelectItem>6    <SelectItem value="external">External</SelectItem>7  </SelectContent>8</Select>

Link triggers

variant link-1 (the brand's color) and link-2 (gray) are the link buttons: text and a small chevron with no box. A link always hugs its value, and size sets only its type, its icon and its gap.

1{(["link-1", "link-2"] as const).map((variant) => (2  <Select key={variant} defaultValue="7d">3    <SelectTrigger variant={variant} aria-label="Period"><SelectValue /></SelectTrigger>4    <SelectContent>5      <SelectItem value="24h">Last 24 hours</SelectItem>6      <SelectItem value="7d">Last 7 days</SelectItem>7      <SelectItem value="30d">Last 30 days</SelectItem>8    </SelectContent>9  </Select>10))}

Over or beside its trigger

By default (alignItemWithTrigger, the first here) the menu opens over the trigger: the chosen row lies on it, its text where the trigger's is and its check in the chevron's place. With touch, or with too little room, it opens beside the trigger instead. alignItemWithTrigger={false} (the second) always opens it beside: 4px away (sideOffset), on a side (bottom unless set), lined up by align (center unless set).

1{[true, false].map((over) => (2  <Select key={String(over)} defaultValue="editor">3    <SelectTrigger aria-label="Role"><SelectValue /></SelectTrigger>4    <SelectContent alignItemWithTrigger={over} align="start">5      <SelectItem value="admin">Admin</SelectItem>6      <SelectItem value="editor">Editor</SelectItem>7      <SelectItem value="viewer">Viewer</SelectItem>8    </SelectContent>9  </Select>10))}

A long list

A list too long for the window scrolls inside the menu, under the ScrollArea's floating thumb. The menu grows to the room on screen: it has no height to set. Typing jumps to the item that starts with what was typed. Today a list this long, opened over its trigger, does not land the chosen row on the trigger.

1const TIMES = Array.from({ length: 48 }, (_, i) => String(Math.floor(i / 2)).padStart(2, "0") + (i % 2 ? ":30" : ":00"));2
3<Select defaultValue="09:00">4  <SelectTrigger aria-label="Run at"><SelectValue /></SelectTrigger>5  <SelectContent>6    {TIMES.map((time) => (7      <SelectItem key={time} value={time}>{time}</SelectItem>8    ))}9  </SelectContent>10</Select>

The trigger's own text

The trigger shows the chosen item's label. SelectValue's children, or a function of the value, show something else: a shorter form where the trigger is tight.

1const SHORT: Record<string, string> = { hour: "1h", day: "24h", week: "7d" };2
3<Select defaultValue="day">4  <SelectTrigger size="xs" aria-label="Window">5    <SelectValue>{(value: string) => SHORT[value]}</SelectValue>6  </SelectTrigger>7  <SelectContent alignItemWithTrigger={false} align="start">8    <SelectItem value="hour">Last hour</SelectItem>9    <SelectItem value="day">Last 24 hours</SelectItem>10    <SelectItem value="week">Last 7 days</SelectItem>11  </SelectContent>12</Select>

In the dashboard

The dashboard has 107 select triggers in 55 files, and seven files whose searchable pickers wear the same trigger (components/shared/entity-combobox.tsx is one). One sets a size; the rest are the default. About 30 start on a placeholder, nine files group their items, and none gives an item an icon or draws a separator yet. None passes width either: 49 fill their container with a w-full class and 37 set a width with a class. Each card below is a copy of a real use and names its file.

A field in a dialog

Under a Field's title, hugging its value, its options in two labelled groups.

components/settings/role-assign-dialog.tsx

A filter over a list

Starts on All outcomes, an item of the list. Its width is a class today (w-[160px]), so the bar holds still as the value changes.

components/judges/rulings-filter-bar.tsx

Rows

Rows per page

The ds Pagination's: a 24px trigger after the word Rows, beside 12px text. Not in the dashboard yet.

ds/components/pagination.tsx

A link in a footer

The date range's time zone: a gray link trigger in the popover's footer, with no box.

components/shared/date-range-picker.tsx

An option not offered yet

The simulator's depth: the second option is disabled, and its label says why. Its menu opens beside the trigger.

components/rules/simulate-panel.tsx

API Reference

The Select is Base UI's Select with the dashboard's look. Each part passes its other props on to the Base UI part it wraps (className, render, the element's own attributes); the tables list what a screen sets. The dashboard's components/ui/select.tsx renders these parts, with the same props.

Select

Base UI's Select.Root. It draws no element of its own.

PropTypeDefaultDescription
valueValue | null—The chosen value, held by you. null is nothing chosen.
defaultValueValue | null—The value it starts on, when it holds its own.
onValueChange(value, details) => void—Called with the new value, or null, and Base UI's event details (reason, cancel()).
disabledbooleanfalseDims the trigger. Nothing opens.
readOnlybooleanfalseThe value shows and can't be changed.
requiredbooleanfalseA value must be chosen before its form submits.
namestring—The field's name when a form is submitted.
formstring—The id of the form that owns it, when it is drawn outside that form.
idstring—The select's id.
autoCompletestring—The browser's autofill hint.
inputRefRef<HTMLInputElement>—The hidden input a form reads.
openboolean—Whether the menu is open, held by you.
defaultOpenbooleanfalseOpen from the start.
onOpenChange(open, details) => void—Called when the menu opens or closes, with why (details.reason: trigger-press, item-press, escape-key, outside-press…).
onOpenChangeComplete(open) => void—Called once the menu has finished opening or closing.
modalbooleantrueWhile the menu is open, the page doesn't scroll and nothing outside it takes the pointer.
highlightItemOnHoverbooleantrueThe item under the pointer is the highlighted one.
itemsRecord<string, ReactNode> | { label, value }[] | Group[]—Each value's label, for the trigger. Left out, it is read from the SelectItem elements among the children: each item's label or text, after its iconStart.
itemToStringLabel(value) => string—For values that are objects: the text the trigger shows.
itemToStringValue(value) => string—For values that are objects: the text a form submits.
isItemEqualToValue(item, value) => boolean—How an item is matched to the value. Object.is unless set.
multiplebooleanfalseBase UI's several-at-once mode. It passes through, with no design of ours: see the open question.
actionsRefRefObject<Select.Root.Actions>—Base UI's imperative handle: close() and unmount().
childrenReactNode—The trigger and the content.

SelectTrigger

Base UI's Select.Trigger, a <button>, with the chevron after its children. It takes a button's props too (id, aria-label, aria-invalid).

PropTypeDefaultDescription
variant"default" | "link-1" | "link-2""default"The secondary button's box, or a link button: the brand's color, or gray, with no box.
size"md" | "sm" | "xs" | "xxs""md"32, 28, 24 or 20px tall. On a link: its type, icon and gap. In a card's header or footer, 28px at most; a smaller size passes through.
width"hug" | "fixed""hug"As wide as its value, or the width it is given (its container's). A link always hugs.
labelstring—What the select is about, in the trigger before its value and a colon (“Type: All”), and its name for a screen reader. Its menu then opens under the trigger.
iconStartIconComponent—An icon of its own before the value, 14px (12 at xs, 10 at xxs): any icon, a logo or an animated one. It shows while the chosen item has no icon or dot.
disabledboolean—Dims this trigger. The select's own disabled does the same.
nativeButtonbooleantrueSet to false when render swaps the button for another element.
renderReactElement | (props, state) => ReactElement—Base UI's way to draw another element in its place.
childrenReactNode—The SelectValue. The chevron follows it.

SelectContent

The menu: Base UI's Select.Portal, Select.Positioner, Select.Popup and Select.List in one, the list inside a ScrollArea. It renders at the end of the page's body.

PropTypeDefaultDescription
alignItemWithTriggerbooleantrueOpens the menu over the trigger, the chosen row on the trigger's text. Not with touch, and not without enough room: the menu then opens beside the trigger.
side"bottom" | "top" | "left" | "right" | "inline-start" | "inline-end""bottom"The side of the trigger the menu opens on, when it is not over it.
sideOffsetnumber | OffsetFunction4The distance from the trigger, in px.
align"center" | "start" | "end""center"How the menu lines up along that side.
alignOffsetnumber | OffsetFunction0A shift along the alignment, in px.
finalFocusboolean | RefObject<HTMLElement> | (closeType) => …—Where focus goes when the menu closes. The trigger unless set.
childrenReactNode—The items, the groups and the separators.

SelectItem

Base UI's Select.Item, with its text and its check inside.

PropTypeDefaultDescription
valueanynullWhat the select's value becomes when this item is chosen.
size"md" | "sm""md"28px tall with 13px text, or 24px with 12px text.
iconStartIconComponent—An icon before the label, 14px (12 at sm). The trigger shows it with the label while this item is chosen.
dot{ color?, size?, halo?, haloSize?, pulse? }—A Status dot before the label, in the icon's place and its box. The trigger shows it with the label while this item is chosen. With a dot, iconStart is not drawn.
badgeBadgeSpec—A Badge at the row's end, before the check's place: { label, color?, emphasis?, iconStart?, iconEnd?, title? }. It stays in the menu.
disabledbooleanfalseDims the item. It can't be chosen; the arrow keys still stop on it.
labelstring—The text typing matches and the trigger shows, when the children are more than plain text.
childrenReactNode—The option's label, on one line.

The small parts

PropTypeDefaultDescription
SelectValue placeholderReactNode—What shows while nothing is chosen, in the muted text.
SelectValue childrenReactNode | (value) => ReactNode—Shown in place of the chosen item's label: fixed content, or a function of the value.
SelectGroup childrenReactNode—Base UI's Select.Group: a SelectLabel, then the items it names.
SelectLabel childrenReactNode—Base UI's Select.GroupLabel: the group's name. Inside a SelectGroup only.
SelectSeparator orientation"horizontal" | "vertical""horizontal"Base UI's Select.Separator: a 1px line across the menu, 4px above and below it.

Also exported from @dome-systems/ds-dashboard/components: selectTriggerClassName and selectTriggerIconClassName, the trigger's look and its chevron's, for a control that opens a picker the way a select does (put the first on the button with a data-size, and end the button with a ChevronDownSmall wearing the second; the ComboboxTrigger does this); and SelectScrollUpButton and SelectScrollDownButton, Base UI's scroll arrows, which SelectContent draws already. collectSelectItems, what the Select reads its labels with, is exported from @dome-systems/ds-dashboard/components/select only.

Rules

Open questions

Do we mark the optional fields, or the required ones?

Open
Ours

The optional ones, with a badge. Required has no mark of its own; a field can pass a Required badge through badge.

Other systems

Atlassian and Primer mark the required ones with an asterisk after the label; Primer even when every field is required, and Atlassian adds a line saying what the asterisk means. Polaris's required shows an indicator.

Where does a radio group end and a select begin?

Open
Ours

No number. The dashboard has selects with two options (the date range's time zone, the simulator's depth) beside radio groups for choices as short (a quota's budget coverage).

Other systems

Polaris: a select from four options up, a choice list for fewer. Primer: with six or fewer and room to spare, consider a radio group. Atlassian: radio buttons for one choice from a set, with no number.

Where is the Native select used rather than the Select?

Open
Ours

Not written down. The Select's source says only this: for the system's own menu, use the Native select, whose options are text only. No screen uses the Native select yet, and the ds Pagination draws its rows per page with the Select.

Other systems

Primer and Polaris: their Select is the browser's own (Polaris read in its source).

A select that picks several

Open
Ours

multiple reaches Base UI through the Select, but nothing is designed for it: how the trigger shows three values is not decided, and no screen uses it. Several values are picked in components/shared/multi-select-combobox.tsx today.

Other systems

Base UI: multiple on the root. Atlassian: a multi select, each choice removed with its x. Primer: a SelectPanel, which stays open after each pick.

How is a choice cleared?

Open
Ours

There is no clear control. A select that may be empty needs an item for it (value={null}, None). No screen does that yet: the two selects with a None item (the verification provider's) give it a value of their own.

Other systems

Atlassian: isClearable adds a clear control for the pointer, and Backspace or Delete clears from the keyboard. Base UI: an item whose value is null; with only a placeholder, the value can't be cleared from the select itself.

Options that are still loading

Open
Ours

No loading look. The hard rules give a wait with no known end to the Loader, and the trigger has no place for one. Three selects write it in the placeholder ("Loading gateways…") while their list is fetched.

Other systems

Atlassian: isLoading shows a loading indicator in the control, and loadOptions takes a promise.

How tall can the menu grow?

Open
Ours

As tall as the room on screen, then it scrolls. Our Dropdown menu takes a maxHeight (160 or 320px); the Select has none. Opened beside its trigger, it trims its last row to a half, as the Dropdown menu does.

Other systems

Atlassian: maxMenuHeight, in px.

Select a pool, or Choose a pool?

Open
Ours

Both. More than ten placeholders say "Select a…", five say "Choose a…", two of those end in an ellipsis, and five are a bare noun (Status, Tenant).

Other systems

Polaris: the word Select, and only when no option is the default. Atlassian: whatever it says, a placeholder never stands in for the label.

In what order do options go?

Open
Ours

Not written down. Options with an order of their own keep it today: the role dialog's durations climb, and rows per page climb.

Other systems

Atlassian: the most chosen first, or by number, and not alphabetical, which does not translate. Primer: alphabetical by default. Polaris: alphabetical, or another logical order.

Which control

A Select picks one value from a list it draws itself. Two of its borders are not decided, and are open questions above: when a short list is a radio group rather than a Select, and where the Native select is used rather than the Select. For the system's own menu, the Select's source says to use the Native select.

Don’tEvery agent in the workspace: 48 here, and the list keeps growing.

A list that grows with the workspace is a searchable picker

Agents, gateways, models, pools and people are lists a workspace keeps adding to. A Select neither pages nor searches: typing only jumps to an item. Those lists go in a searchable picker, a Popover holding a Command behind the ComboboxTrigger.

From the repo's scale rules (.claude/rules/scale.md, Surfaces: every list pages or searches) and Base UI (its Combobox once a list is long enough to need filtering).

DoActions: a Button that opens a Dropdown menu.
Don’tPicking Delete here would leave Delete showing as the value.

A Select sets a value. A Dropdown menu runs an action

What is chosen in a Select stays there as the field's value. Items that do something (edit, delete) go in a Dropdown menu, opened by a Button that names it.

From Atlassian, which gives a list of actions that run at once to its dropdown menu.

Label, default and options

Model pool
DoThe title stays. The placeholder says what to do.
Don’tOnce Fast is chosen, nothing says what Fast is.

Every select has a name, and the placeholder is not it

In a form, the select sits in a Field, whose title names it. With no Field, the trigger takes an aria-label, or an id a <label> points at: its text is its value, so it has no name of its own.

From Atlassian (a label outside the field, always in sight; a placeholder is never the label, because it goes once a value is entered).

Start on a default when there is one

When one option is the usual one, start on it with defaultValue. When none is, start empty, on a placeholder.

From Primer (a default option when possible) and Polaris (a default when possible; a placeholder only when no option is the logical one).

Don’tLoose items over a group of one.

Group all of the options, or none

The Groups example above is the one to copy: every item in a group, every group named, none of one item. A SelectLabel sits inside its SelectGroup, which is what names the group for a screen reader.

From Atlassian (group only when every item belongs to a group, never a group of one, and only by kinds most people know).

The trigger and the menu

DoA select beside a button: one fill, one edge, one height.
Don’tA fill and a border of its own, and a picker made by hand with the large chevron at 16px.

The trigger is the secondary button, and its chevron the small one

The trigger wears the secondary button's fill, edge, text and hover at the button's four sizes, with the Input's focus band and invalid edge. Its tokens point at the button's, so the two change together. It ends in ChevronDownSmall at 14px (12 at xs, 10 at xxs), drawn for you.

className on a trigger is for where it sits. Its look is variant and size, and its edge is a shadow.

From ds/README.md, the Select row, and the dashboard's hard rules 3 and 5 (chevrons are the small ones, at 14px; an edge is a shadow, never a border).

DoA 28px select beside a 28px button.
Don’t32 beside 28.

In a card's header, footer or toolbar: 28px at most

In a card's header or footer a medium trigger renders small without being told. In a toolbar, pass size="sm". The height is the size, not a class.

From the dashboard's hard rule 10.

DoOpen it: a check on Editor, and no fill until the pointer is there.
Don’tOpen it: a fill that stays on the chosen item reads as the pointer's.

The chosen item is marked by its check alone

In the menu a fill means the pointer or the keyboard is here, and the check means this is the value. The chosen item gets the small check at its end and nothing else. The check is the small chevron's sibling, in the same box, so over its trigger it takes the chevron's place.

From ds/README.md, the Select row.

DoA Select and a picker, side by side: one control.
Don’tThe picker as a ghost button: two looks for one job.

A searchable picker wears the same trigger

A picker (a Popover holding a Command) takes the Select's trigger through the dashboard's ComboboxTrigger, at the same sizes, with the same chevron. Here the picker is drawn closed, from selectTriggerClassName.

From ds/README.md, the Select row, and components/shared/combobox-trigger.tsx.

Accessibility

The keyboard and the roles are Base UI's. The keys and the attributes below were read from this page in Chromium. What a screen reader says with them was not tested.

KeyOn the triggerIn the open menu
Enter, SpaceOpens the menu, on the chosen item.Chooses the highlighted item and closes.
Arrow down, Arrow upOpens the menu, on the chosen item.Moves to the next or the previous item, and stops at the ends.
Home, EndNothing.Moves to the first or the last item.
A letter, or a fewChooses the item that starts with it, without opening.Moves to the item that starts with it.
EscapeNothing.Closes. The value stays, and focus is back on the trigger.
TabMoves on to the next control.Closes and moves on to the next control. The value stays.

Its name. The trigger has no name of its own: its text is its value. Inside a Field, the field's title names it (aria-labelledby), and its description and its error are tied to it (aria-describedby). Outside one, give the trigger an aria-label, or an id that a <label> points at.

Roles. The trigger is a <button> with role="combobox", aria-haspopup="listbox" and aria-expanded. The list is a listbox, and each item an option with aria-selected, so the check is not the only signal. A group is a group named by its label. A disabled item has aria-disabled, and the arrow keys still stop on it. The chevron and the check are aria-hidden. A disabled select's trigger is a disabled button: it takes no focus.

Focus. The trigger shows the Input's focus band. Opening moves focus into the menu, onto the chosen item, and Escape or a choice returns it to the trigger. While the menu is open the page doesn't scroll and nothing behind it can be pressed.

Not by color alone. An invalid select in a Field has aria-invalid, its red edge and the field's error under it, in words.

What others expose

What the same component offers in shadcn/ui, Base UI, Atlassian, Shopify Polaris and GitHub Primer that ours does not. Each name was read on that system's own page or in its source. "Ask" means it is one of the open questions under Rules.

They exposeWhoOurs
Picking several valuesBase UI (multiple), Atlassian (isMulti), Primer (SelectPanel)Ask. See "A select that picks several".
A control that clears the valueAtlassian (isClearable), Base UI (an item whose value is null)Ask. See "How is a choice cleared?".
A loading stateAtlassian (isLoading, loadOptions)Ask. See "Options that are still loading".
A maximum height for the menuAtlassian (maxMenuHeight), our own Dropdown menu (maxHeight)Ask. See "How tall can the menu grow?".
The browser's own select as the SelectPrimer, PolarisAsk. See "Where is the Native select used rather than the Select?". Ours is its own component, with the same trigger.
Search inside the listAtlassian (isSearchable), Primer (SelectPanel's filter), Base UI (its Combobox)Not needed, because a list to search is the searchable picker, which wears this trigger.
A label, a help text and an error of its ownPolaris (label, helpText, error), Primer (FormControl's label, caption and validation), Base UI (Select.Label)Not needed, because the Field carries the title, the description and the error for every control, and marks the trigger invalid.
A required markPolaris (requiredIndicator), Primer (a required indicator)Ask: nobody has decided whether required fields get a mark. Today the Field carries an Optional badge, and the select itself takes required. See the open question on required fields.
A quiet trigger with no box until hoverAtlassian (appearance: subtle)Not built. The link triggers are our boxless ones; the Native select has a ghost variant, and the Select has none.
Options passed as dataPolaris (options), Atlassian (options), shadcn and Base UI (items)Not needed, because items are written as elements, which is what lets one take an icon or be disabled. items still passes through, for labels.
Parts and settings ours does not pass onBase UI (Select.Backdrop, Select.Arrow, the portal's container, collisionPadding, sticky, positionMethod, anchor)Not built: SelectContent passes on the side, the alignment, their offsets and alignItemWithTrigger only. Our own Dropdown menu takes a container.
Right to leftshadcn (an RTL example)Not built. Base UI's logical sides (inline-start, inline-end) pass through.