Skip to content

Select

Single-choice menu for forms and filters. Prefer select when options are longer than a short radio group.

Examples

Fruit

Overview

Select is a composed Base UI control: trigger with value and icon, then a portaled popup list of items. Pass an items map on the root so SelectValue can show labels instead of raw values.

tsx

import {
  Select,
  SelectTrigger,
  SelectValue,
  SelectIcon,
  SelectPortal,
  SelectPositioner,
  SelectPopup,
  SelectList,
  SelectItem,
  SelectItemText,
} from "@standard-ui/react"

<Select
  items={{ apple: "Apple", banana: "Banana", cherry: "Cherry" }}
  defaultValue="apple"
>
  <SelectTrigger>
    <SelectValue />
    <SelectIcon />
  </SelectTrigger>
  <SelectPortal>
    <SelectPositioner>
      <SelectPopup>
        <SelectList>
          <SelectItem value="apple">
            <SelectItemText>Apple</SelectItemText>
          </SelectItem>
        </SelectList>
      </SelectPopup>
    </SelectPositioner>
  </SelectPortal>
</Select>

Usage

Items map

When you pass items, SelectValue renders the matching label for the selected value. Keep keys aligned with each item's value.

tsx

<Select
  items={{ apple: "Apple", banana: "Banana", cherry: "Cherry" }}
  defaultValue="apple"
>
  {/* trigger + popup */}
</Select>

Anatomy

Compose the full tree so positioning and accessibility stay intact: trigger → portal → positioner → popup → list → item.

tsx

Select
  SelectTrigger
    SelectValue
    SelectIcon
  SelectPortal
    SelectPositioner
      SelectPopup
        SelectList
          SelectItem
            SelectItemText

API

Root accepts Base UI Select props. Common props and parts:

Prop / partTypeDefaultDescription
itemsRecord<string, ReactNode>Value → label map for SelectValue.
defaultValuestring | nullUncontrolled initial value.
valuestring | nullControlled value.
onValueChange(value, event) => voidCalled when the selection changes.
disabledbooleanfalseDisables the select.
SelectTriggerOpens the popup; hosts value and icon.
SelectItemOption row. Requires a value.

Guidelines

Do

  • Pass items when values differ from display labels
  • Keep option labels short and scannable
  • Use a placeholder on SelectValue when nothing is selected

Don't

  • Don't skip SelectPositioner — placement depends on it
  • Don't use select for binary on/off — prefer Switch
  • Don't leave items without a stable value