Pop-up Button

A pop-up button that opens a menu of options, in bordered and System Settings styles.

Installation

pnpm dlx shadcn@latest add @cupertinoui/select

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"

<Select defaultValue="medium">
  <SelectTrigger>
    <SelectValue />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="small">Small</SelectItem>
    <SelectItem value="medium">Medium</SelectItem>
  </SelectContent>
</Select>
By default the menu opens over the trigger with the selected item aligned to it, like a macOS pop-up button. Pass alignItemWithTrigger={false} to open it below instead.
Give Select an items map (value → label) so SelectValue shows the chosen item's label rather than its value, as in Base UI.

Examples

Borderless

The style System Settings uses in grouped forms: the value followed by chevrons in a round chip.

Sizes

Groups

Labels and separators organize long menus.

API Reference

Every part forwards the props of the underlying Base UI Select part. The props below are the ones CupertinoUI adds or changes.

Select

PropTypeDescription
value / defaultValuestringThe selected value.
itemsRecord<string, ReactNode> | { value, label }[]The labels SelectValue shows for each value.
onValueChange(value: string) => voidCalled when the selection changes.

SelectTrigger

PropTypeDescription
variant"default" | "borderless"
Default: "default"
Bordered pop-up button or the System Settings style.
size"sm" | "default" | "lg"
Default: "default"
20, 24 or 28pt tall.
classNamestringExtra classes, merged with the component's own.

SelectContent

PropTypeDescription
alignItemWithTriggerboolean
Default: true
Opens over the trigger with the chosen item on it; false opens below.
classNamestringExtra classes, merged with the component's own.

SelectItem

PropTypeDescription
valuestringThe value of the option.
disabledbooleanDims the option.