Skip to content
ComponentsMarkdown

Select

Single-selection dropdown built on Radix Select. Trigger sizes (xs to lg) match Input, and the floating listbox portals to body with popper width matching.

Live example

Selected theme: verdigris

Props

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg""md"Trigger height, corner radius, horizontal padding, and chevron icon size.
aria-invalidboolean | "true" | "false"falseSwitches the trigger border to --destructive; wired automatically inside Field.
disabledbooleanfalseDisables the trigger using step 3 background and step 8 text without opacity.
position"popper" | "item-aligned""popper"Positions SelectContent directly below SelectTrigger at matching width.
namestring—Submits the selected value in native HTML forms via FormData.

Sizes and tokens

Tier / RoleTokenValue
xs--control-height-xs / --control-icon-xs24px height · radius-sm (4px) · 16px chevron · 16px text
sm--control-height-sm / --control-icon-sm32px height · radius-sm (4px) · 16px chevron · 16px text
md--control-height-md / --control-icon-md40px height · radius-md (8px) · 20px chevron · 16px text
lg--control-height-lg / --control-icon-lg48px height · radius-md (8px) · 24px chevron · 16px text
Popup surface--popover / --popover-foreground / --shadow-md / --z-dropdownStep 3 surface · 1px border · shadow-md (light) · z-index 20
Highlighted item--secondary-hoverNeutral step 4 background on keyboard or pointer highlight

States

Popper menu matches trigger width.

Code

import {
  Field,
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectLabel,
  SelectSeparator,
  SelectTrigger,
  SelectValue,
} from "@freshgemui/monoplinth";

export function Example() {
  return (
    <Field label="Brand theme" description="Applied to primary accents." required>
      <Select name="theme" defaultValue="verdigris">
        <SelectTrigger>
          <SelectValue placeholder="Choose theme" />
        </SelectTrigger>
        <SelectContent>
          <SelectGroup>
            <SelectLabel>Mineral</SelectLabel>
            <SelectItem value="mono">Mono</SelectItem>
            <SelectItem value="porphyry">Porphyry</SelectItem>
          </SelectGroup>
          <SelectSeparator />
          <SelectGroup>
            <SelectLabel>Metal</SelectLabel>
            <SelectItem value="verdigris">Verdigris</SelectItem>
            <SelectItem value="brass">Brass</SelectItem>
          </SelectGroup>
        </SelectContent>
      </Select>
    </Field>
  );
}

Do and don't

Do: Use groups and labels for long option lists
Organize related options with SelectGroup, SelectLabel, and SelectSeparator so users can scan choices quickly.
Don't: Rely on color alone for the selected option
Always keep the leading Check indicator in SelectItem so selection is clear without color perception.

Accessibility

  • SelectTrigger reads id, aria-describedby, aria-invalid, and aria-required from the nearest Field context automatically.
  • Enter, Space, and ArrowDown open the listbox; ArrowUp and ArrowDown move highlight; Enter selects and closes.
  • Selected options render a Lucide Check icon alongside text (WCAG 1.4.1).
  • Disabled triggers use step 3 background and step 8 text with no opacity reduction.

Rationale

Aligning SelectTrigger to the exact --control-height-*, --control-radius-*, and 16px text scale of Input lets text inputs and selects sit side by side in forms without vertical misalignment.