Umbra UI

Select

Picks one value from a list, with groups and typeahead.

Staticimport { Select } from 'umbra-ui'

Props

Select

PropTypeDefaultDescription
children requiredReactNode—`SelectItem`, `SelectGroup` and `SelectSeparator` elements.
defaultOpen boolean—Initial open state when uncontrolled.
defaultValue string—Initial value when uncontrolled.
invalid boolean—Marks the value as invalid (sets `aria-invalid`). Inherited from FormField when omitted.
name string—Field name submitted with a form.
onOpenChange ((open: boolean) => void)—Called when the listbox opens or closes.
onValueChange ((value: string) => void)—Called with the newly selected value.
open boolean—Controlled open state.
placeholder ReactNode—Text shown when no value is selected.
required boolean—Marks the field as required for form validation.
size "sm" | "md" | "lg"mdControl height.
value string—Controlled value.

SelectItem

PropTypeDefaultDescription
children requiredReactNode—Option label.
value requiredstring—Value reported to `onValueChange` and submitted with forms.

SelectGroup

PropTypeDefaultDescription
label requiredReactNode—Visible group heading, announced with the group.

Usage notes

Built on Radix Select. Remaining props go to the trigger button.

Accessibility

  • Trigger has role="combobox"; the list is a listbox with options.
  • Space, Enter or ↓ opens; ↑/↓ move; Home/End jump; typing jumps to a matching option; Escape closes and returns focus.
  • SelectGroup labels its options for screen readers.

Import

import { Select, SelectItem, SelectGroup } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app