Select
Displays a list of options for the user to pick from—triggered by a button.
Installation
terminal
npx felicityui add select --platform reactUsage
example.tsx
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
<Select defaultValue="system">
<SelectTrigger className="w-[180px]">
<SelectValue placeholder="Theme" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem value="light">Light</SelectItem>
<SelectItem value="dark">Dark</SelectItem>
<SelectItem value="system">System</SelectItem>
</SelectGroup>
</SelectContent>
</Select>Composition
Select
├── SelectTrigger
│ └── SelectValue
└── SelectContent
├── SelectGroup
│ ├── SelectLabel
│ └── SelectItem
└── SelectSeparatorDefault
Align item with trigger
alignItemWithTrigger={false} keeps the popup edge-aligned.
Groups
SelectGroup, SelectLabel, and SelectSeparator.
Citrus
Berry
Scrollable
Long lists scroll inside SelectContent.
Disabled
Invalid
error / invalid set data-invalid and aria-invalid.
Choose a fruit to continue.
RTL
dir=rtl
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | Controlled selected value. |
| defaultValue | string | — | Uncontrolled initial value. |
| onValueChange | (value: string) => void | — | Called when selection changes. |
| alignItemWithTrigger | boolean | true | Scroll selected item into view when opening. |
| label | ReactNode | — | Optional field label. |
| error | ReactNode | — | Error message; sets invalid styling. |
| disabled | boolean | — | Disables the select. |
Accessibility
WCAG 2.2 AA
- Trigger is combobox with
aria-expandedandaria-controls. - Popup is listbox; items are options with
aria-selected. - Arrow key navigation, Escape closes.
aria-invalidwhen invalid.
Platform notes
React
Custom combobox/listbox with Felicity tokens. Paper surface, hairline border — not Base UI / Radix runtime. Prefer native-select for a plain HTML select.
- Client component (open/value state).
- Composition: SelectTrigger, SelectValue, SelectContent, SelectGroup, SelectLabel, SelectItem, SelectSeparator.
- alignItemWithTrigger scrolls the selected item into view on open.
- Optional Felicity field chrome via label/description/error on Select.