Select
One choice from a known list of about 5–15 options: Base UI's Select, inside a Field. For 2–4 options that should stay visible use Radio or Toggle Group; for long or searchable lists use Combobox.
import { Select } from '@fairgarden/design/forms/select'
Pass items (options, or titled groups) and a placeholder that ends in "…". Label the trigger with <FieldLabel nativeLabel={false}>, which focuses it without opening the popup. The popup opens --size-px-2 below the trigger, never on hover and never as a sheet; at most 8 items show before it scrolls. For custom rows, pass SelectItem, SelectGroup and SelectSeparator as children.
Variants and states
Variants and states
The boxed trigger is the field box; variant="underline" sets the trigger over a --border-size-2 --role-accent underline that hugs its content. Highlighted items take the --primary4 soft fill and a --border-size-2-25 start bar; the chosen item a leading ✓ and --font-weight-6; a disabled item stays muted and is never highlighted. An option with a swatch draws the product's color before its name.
Primary and secondary
Primary and secondary
primary sets the trigger's edge, value and chevron; secondary the underline. While invalid, the danger scale turns the boxed edge and the underline to the error ink. The popup never inherits the trigger's scales.
On grounds
On paper and forest
The trigger follows its ground; the popup renders in a portal as the white scope, framed by --border-size-2 --primary12 in both modes.
paper
forest
Outline morph
Outline morph
On by default: as the popup opens, the trigger's focus ring grows into the popup's --border-size-2 --primary12 frame, and the list is revealed inside it; on close the frame shrinks back onto the ring. Opened by pointer, where no ring shows, the field edge grows instead. The trigger's own styles are unchanged: the growing frame is an overlay, and it gives way to the popup's own frame the moment it lands. It opens over --fgd-duration-expand on --fgd-ease-expand and closes over --fgd-duration-disclosure; under reduced motion it is instant, and in forced colors and print the popup opens as usual. morph={false} opens and closes the popup at once; see Outline Morph for the app-wide switch. The last select sits at the foot of a tall stage: with the demo near the top of the window it opens upward, and the outline grows up.
API Reference
Select
A Base UI Select inside a Field (label it with
<FieldLabel nativeLabel={false}>). The popup opens below the trigger,
never on hover, and is never a sheet; use Combobox for long or
searchable lists and Radio for 2–4 visible options.
| Prop | Type | Description |
|---|---|---|
aria-label | | Names the trigger when no visible label exists. Prefer a |
items | | The options (or titled groups). Rendered as items unless |
morph | | The outline morph: the focus ring grows into the popup’s frame as it
opens and shrinks back as it closes; opened by pointer (no ring), the
field edge grows instead. Instant under reduced motion; off in forced
colors and print, and wherever |
placeholder | | Shown in --role-muted while nothing is chosen; end it with “…". |
plate | | The trigger’s face becomes a nested |
primary | | Primary Radix scale: trigger edge, value, chevron and focus ring. Never defaulted; omitted, it inherits the scope [D133]. |
secondary | | Secondary Radix scale: the underline variant’s underline; the danger scale while invalid. |
variant | |
|
children | | Custom list content ( |
className | | Class names for the trigger (the root part), added after the module’s own. |
SelectItem, SelectGroup and SelectSeparator
One option: a --fgd-size-hit row. Highlighted rows take the --primary4
soft fill and the --border-size-2-25 start bar; the chosen row a leading ✓
and --font-weight-6 [D145].
| Prop | Type | Description |
|---|---|---|
swatch | | The product’s color (content) as a ringed disc before the label. |
className | | Extra class names, added after the module’s own. |
A titled group of items.
| Prop | Type | Description |
|---|---|---|
label | | The group label, in |
className | |
The one popup group separator: --border-size-1 in --role-rule.
| Prop | Type | Description |
|---|---|---|
className | |
Additional types
SelectGroupProps
Props for SelectGroup: Base UI Select.Group props plus its label.
type SelectGroupProps = {
/** The group label, in `type-label` caps and --role-muted. */
label: React.ReactNode;
className?: string;
}SelectItemProps
Props for SelectItem: Base UI Select.Item props plus an optional swatch.
type SelectItemProps = {
/** Extra class names, added after the module's own. */
className?: string;
/** The product's color (content) as a ringed disc before the label. */
swatch?: string;
}SelectOption
One option: its value, its label (the words the trigger shows) and an optional swatch.
type SelectOption<Value = string> = {
value: Value;
/** The option's words; with a swatch they name the color. */
label: string;
/**
* The product's color, supplied as data like a photograph (a CSS color
* string); drawn as a ringed disc before the label. Always name the color
* in `label`.
*/
swatch?: string;
disabled?: boolean;
}SelectOptionGroup
A titled group of options; groups are divided by the popup’s separator.
type SelectOptionGroup<Value = string> = {
/** The group label, set in `type-label` caps. */
label: string;
items: SelectOption<Value>[];
}SelectProps
Props for Select: Base UI Select.Root props plus the options, variant and color axes.
type SelectProps<Value = string> = (
{ variant?: 'outline'; plate?: boolean } | { variant: 'underline'; plate?: false }
) & {
/**
* The options (or titled groups). Rendered as items unless `children`
* are given; always used to show the chosen option's label.
*/
items?: SelectItems<Value>;
/** Custom list content (`SelectItem`, `SelectGroup`, `SelectSeparator`) instead of `items`. */
children?: React.ReactNode;
/** Shown in --role-muted while nothing is chosen; end it with "…". */
placeholder?: string;
/** Class names for the trigger (the root part), added after the module's own. */
className?: string;
/** Names the trigger when no visible label exists. Prefer a `FieldLabel`. */
'aria-label'?: string;
/**
* Primary Radix scale: trigger edge, value, chevron and focus ring. Never
* defaulted; omitted, it inherits the scope [D133].
*/
primary?:
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'ruby'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| null;
/**
* Secondary Radix scale: the underline variant's underline; the danger
* scale while invalid.
*/
secondary?:
| 'olive'
| 'sage'
| 'slate'
| 'sand'
| 'gray'
| 'mauve'
| 'brown'
| 'bronze'
| 'gold'
| 'red'
| 'ruby'
| 'crimson'
| 'tomato'
| 'pink'
| 'plum'
| 'indigo'
| 'iris'
| 'violet'
| 'purple'
| 'amber'
| 'blue'
| 'cyan'
| 'grass'
| 'green'
| 'jade'
| 'lime'
| 'mint'
| 'orange'
| 'sky'
| 'teal'
| 'yellow'
| null;
/**
* The outline morph: the focus ring grows into the popup's frame as it
* opens and shrinks back as it closes; opened by pointer (no ring), the
* field edge grows instead. Instant under reduced motion; off in forced
* colors and print, and wherever `--fgd-outline-morph: none` applies.
* Default `true`; `false` opens and closes the popup at once.
*/
morph?: boolean;
}SelectSeparatorProps
Props for SelectSeparator: Base UI Select.Separator props.
type SelectSeparatorProps = { className?: string }Specification: DESIGN-SYSTEM.md §10.5 (select) and §10.1 (the overlay surface).