✦ Asteria UI
Components

Select

Dropdown selection input with sm/md/lg/xl sizes and an error state, built on Radix UI.

Installation

npx asteria-ui add select

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select";

<Select onValueChange={setFramework}>
  <SelectTrigger aria-label="Framework">
    <SelectValue placeholder="Select a framework" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="react">React</SelectItem>
    <SelectItem value="vue">Vue</SelectItem>
  </SelectContent>
</Select>

Examples

Sizes

States

API reference

SelectTrigger

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl""md"Density — 32 / 40 / 48 / 56px trigger height.
errorbooleanMarks the trigger invalid — sets aria-invalid and the error border color.
disabledbooleanDisables the trigger — prevents opening the listbox.

Select, SelectValue, SelectContent, SelectItem, SelectGroup, SelectLabel, and SelectSeparator pass their props straight through to the underlying Radix UI Select primitives.

  • Dropdown Menu — for actions, not selection
  • Radio Group — for small option sets
  • Field — wraps with label + helper

Accessibility

Accessibility

  • Role. The trigger has an implicit role="combobox" with aria-expanded reflecting the open state.

  • Listbox. aria-controls links the trigger to the listbox; aria-activedescendant tracks the highlighted option.

  • Keyboard. Arrow keys navigate options, Enter selects, Escape closes, and type-ahead search jumps to a matching option.

  • Error. The error prop sets aria-invalid="true" on the trigger.