Skip to content

Select

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

Install

Bash
npx @madeui/cli add select

Usage

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

Composition

TSX
<Select>
  <SelectTrigger>
    <SelectValue />
  </SelectTrigger>
  <SelectContent>
    <SelectItem />
  </SelectContent>
</Select>

Groups

Scrollable

Disabled options

Disabled

Invalid

Wrap Select in a Field with invalid — the error propagates to the trigger automatically (aria-invalid/data-invalid), while FieldLabel and FieldError carry the visible error state.

API reference

Built on Base UI Select. The tables below cover the props this library adds or changes — every other prop is forwarded to the underlying Base UI part; see the Base UI Select API reference for the full list.

Select (Root)

PropTypeDefaultDescription
items{ label: string; value: any }[]—Item list; lets SelectValue render the selected label.
valueany—Controlled selected value.
defaultValueany—
onValueChange(value: any) => void—
disabledbooleanfalse

SelectContent

PropTypeDefaultDescription
alignItemWithTriggerbooleantrueOverlay the popup on the trigger with the selected item’s text aligned to it (macOS-style, with scroll arrows). Set false for a plain anchored dropdown below the trigger.
side'top' | 'right' | 'bottom' | 'left''bottom'Anchored mode only.
sideOffsetnumber4Distance from the trigger, in px.
align'start' | 'center' | 'end''center'Anchored mode only.
alignOffsetnumber0
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

SelectItem

PropTypeDefaultDescription
value (required)any—
disabledbooleanfalse
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Styling

SelectTrigger, SelectLabel, and SelectSeparator accept style (StyleXStyles, merged last so caller overrides always win) plus all native props of the element they render.

SelectValue and SelectGroup are Base UI parts re-exported unstyled.

Was this page helpful?