Redpanda UIRedpanda UI

Select

Displays a list of options for the user to pick from—triggered by a button.

Made by shadcn

Installation

Loading component...

When to use

Select components provide single-option selection from a list of options. Use this decision tree:

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"
<Select>
  <SelectTrigger className="w-[180px]">
    <SelectValue placeholder="Theme" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="light">Light</SelectItem>
    <SelectItem value="dark">Dark</SelectItem>
    <SelectItem value="system">System</SelectItem>
  </SelectContent>
</Select>

Anatomy

The Select component is built with Base UI primitives:

<Select> (Root Container)
├── <SelectTrigger> (Button)
│   ├── <SelectValue> (Placeholder/Selected)
│   └── <ChevronDown> Icon
├── <SelectContent> (Dropdown)
│   ├── Portal rendering
│   ├── Positioning system
│   └── <SelectItem> (Options)
│       ├── Checkmark indicator
│       └── Item text
└── Keyboard/Mouse handling

Props

Examples

Scrollable

Loading component...

Groups

Loading component...

Disabled options

Loading component...

With description

Loading component...

With icon

Loading component...

Status indicator

Loading component...

Avatars

Loading component...

Custom rendering

Loading component...

Object values

Loading component...

Placeholder and clearable

Loading component...

Error state

Loading component...

Loading state

Loading component...

Form

Loading component...

Keyboard interactions

KeyAction
Enter / Space / ArrowDown on SelectTriggerOpens the listbox and focuses the currently selected item (or the first if none).
ArrowUp / ArrowDownMoves between options.
Home / EndJumps to first / last option.
EnterSelects the focused option and closes the listbox.
EscapeCloses without changing selection.
Typing a characterTypeahead jumps to the next option whose label starts with that character.

Accessibility

  • SelectTrigger is a real button with aria-haspopup="listbox" and aria-expanded; the listbox carries role="listbox" and each item role="option" with aria-selected.
  • Provide a visible label via <Label htmlFor> or wrap the select in a <Field> so the selected value has a programmatic name.
  • onValueChange is the Radix-style single-argument (value: string) => void; the compat layer narrows Base UI's (value, details) signature.
  • For large option lists (>20), prefer Combobox so users can type-ahead-filter. Select's typeahead only jumps to matching first letters.

Credits

  • We use Base UI for the select component.
  • We take our inspiration from Shadcn UI for the select style.

Recent changes

  • patchv1.2.0Pin shipped dependency floors to the version we develop against. Registry items now declare ranges like `^5.1.9` (the actual installed version) instead of collapsing to `^5.0.0`, so consumers start on the known-tested b…#133
  • minorv1.1.0Theme docs refresh, readability pass on semantic foregrounds, and consumer-facing Base UI regression fixes.#121
  • minorv1.0.0Post-Base-UI polish. Public API unchanged.#116
  • majorv1.0.0Migrate every Radix-based primitive to `@base-ui/react@^1.4.0` (Base UI).#114
  • patchv0.3.1**Accordion** - `AccordionTrigger` now shows `cursor-pointer` on hover.#112
See full history →
Built by malinskibeniamin. The source code is available on GitHub.

On this page