Select

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

formoverlayinteractive
Loading preview...

System specimen

The selection and search family shares control geometry, popup surfaces and option rows. Select and Combobox keep persistent selection checks while the highlighted row marks transient keyboard navigation. This specimen includes async results, loading, empty states, chips, Command content, and a 500-project list.

Loading preview...

Installation

Terminal
npx baseui-cn add select

Usage

Code
import {
  Select,
  SelectTrigger,
  SelectValue,
  SelectContent,
  SelectGroup,
  SelectLabel,
  SelectItem,
  SelectSeparator,
} from "@/components/ui/select"
Code
<Select>
  <SelectTrigger>
    <SelectValue placeholder="Select a framework" />
  </SelectTrigger>
  <SelectContent>
    <SelectGroup>
      <SelectLabel>Frameworks</SelectLabel>
      <SelectItem value="next">Next.js</SelectItem>
      <SelectItem value="remix">Remix</SelectItem>
    </SelectGroup>
  </SelectContent>
</Select>

Examples

Basic

A simple select.

Loading preview...

Controlled

A controlled select.

Loading preview...

With groups

Group options with SelectGroup.

Loading preview...

Sizes

default and sm sizes.

Loading preview...

Disabled

A disabled select and disabled items.

Loading preview...

API

SelectTrigger

PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Height of the select trigger button

SelectContent

PropTypeDefaultDescription
side"top" | "bottom" | "left" | "right""bottom"Side of the trigger the listbox appears on
sideOffsetnumber4Distance in px between the listbox and the trigger
align"start" | "center" | "end""center"Alignment relative to the trigger
alignOffsetnumber0Offset in px along the alignment axis
alignItemWithTriggerbooleantrueVisually align the selected item inside the popup with the trigger text

API Reference

See the Base UI Select documentation for the full API reference, including all props, data attributes, and CSS classes.