Select
A single choice from a longer list, in a popup. Built on Base UI Select, which owns the popup, keyboard typeahead and the listbox ARIA wiring. Exposed as composable parts; pass items to the root so the trigger shows the chosen label. Add searchable when the list gets long enough that scanning is slower than typing.
Virtualized · 10,000 options
Pass virtualized and a flat options array to mount only visible options. Combine with searchable to filter before virtualizing. Labels, disabled options, keyboard navigation and selected values work across offscreen options. Use textValue for rich labels. Grouped options are not supported in virtualized mode.
10,000 options · Record 3 is disabled
Selected: Record 9001
Selected: None
Try searching “Record 10000”, or use End in the browse list to reach the last option.
const options = Array.from({ length: 10_000 }, (_, index) => ({ value: `record-${index}`, label: `Record ${index + 1}`, disabled: index === 2,}));
// Browse all 10,000 options; start with an offscreen selection.<Select virtualized options={options} defaultValue="record-9000"> <SelectTrigger aria-label="Virtual record"> <SelectValue placeholder="Choose a record" /> </SelectTrigger> <SelectContent maxHeight={240} estimatedRowHeight={32} overscan={6} /></Select>
// Search the full dataset, then virtualize the matching options.<Select virtualized searchable options={options}> <SelectTrigger aria-label="Search virtual records"> <SelectValue placeholder="Search 10,000 records" /> </SelectTrigger> <SelectContent searchPlaceholder="Find record" maxHeight={240} /></Select><Select items={fonts} defaultValue="inter"> <SelectTrigger><SelectValue placeholder="Pick a font" /></SelectTrigger> <SelectContent> <SelectItem value="inter">Inter</SelectItem> <SelectItem value="system">System</SelectItem> <SelectItem value="georgia">Georgia</SelectItem> <SelectItem value="mono">JetBrains Mono</SelectItem> </SelectContent></Select>With a label and placeholder
<Label htmlFor="font">Body font</Label><Select items={fonts}> <SelectTrigger id="font"><SelectValue placeholder="Choose…" /></SelectTrigger> <SelectContent>{/* items */}</SelectContent></Select>Searchable
Pass searchable to add a live-filtering search field at the top of the popup. Flab swaps the underlying primitive to Base UI Combobox so keyboard focus stays in the input while ↑/↓ move the highlight and Enter selects. Items are matched against their rendered text; supply textValue when the label is non-textual.
<Select searchable items={fonts} defaultValue="inter"> <SelectTrigger><SelectValue placeholder="Pick a font" /></SelectTrigger> <SelectContent searchPlaceholder="Search fonts" emptyMessage="No fonts match"> <SelectItem value="inter">Inter</SelectItem> <SelectItem value="system">System</SelectItem> <SelectItem value="georgia">Georgia</SelectItem> <SelectItem value="mono">JetBrains Mono</SelectItem> </SelectContent></Select>Searchable with many items
Once the list gets longer than a screen-worth, search stops being optional. This one filters over 30 timezones as you type.
<Select searchable items={timezones}> <SelectTrigger><SelectValue placeholder="Timezone" /></SelectTrigger> <SelectContent searchPlaceholder="Search timezones"> {timezones.map((tz) => ( <SelectItem key={tz.value} value={tz.value}>{tz.label}</SelectItem> ))} </SelectContent></Select>Grouped options
<Select items={fonts}> <SelectTrigger><SelectValue placeholder="Pick a font" /></SelectTrigger> <SelectContent> <SelectGroup> <SelectGroupLabel>Sans-serif</SelectGroupLabel> <SelectItem value="inter">Inter</SelectItem> <SelectItem value="system">System</SelectItem> </SelectGroup> <SelectSeparator /> <SelectGroup> <SelectGroupLabel>Serif & mono</SelectGroupLabel> <SelectItem value="georgia">Georgia</SelectItem> <SelectItem value="mono">JetBrains Mono</SelectItem> </SelectGroup> </SelectContent></Select>Parts
| Prop | Type | Default | Notes |
|---|---|---|---|
Select | Root | — | Holds value/defaultValue, onValueChange, name, items. |
Select.searchable | boolean | false | Swaps to Combobox internals and adds the search field. |
SelectTrigger | button | — | The field; renders a chevron. |
Select.virtualized | boolean | false | Window flat options; keeps offscreen keyboard navigation available. |
Select.options | SelectOption[] | — | Data-driven { value, label, disabled?, textValue? } options. Optional for flat composed SelectItems. |
SelectContent.maxHeight | number | 240 | Option viewport height in px in data-driven / virtualized mode. |
SelectContent.estimatedRowHeight / overscan | number | 32 / 8 | Height estimate and buffer options. Actual rows are measured. |
SelectValue | element | — | Shows the selected label (from items) or the placeholder. |
SelectContent | popup | — | Portals and positions the list. |
SelectContent.searchPlaceholder | string | 'Search…' | Placeholder for the search field when `searchable`. |
SelectContent.emptyMessage | ReactNode | 'No results' | Shown when the query matches nothing. |
SelectItem | option | — | One choice; needs a value. |
SelectItem.textValue | string | — | Search-matching text when the label is non-textual. |
SelectGroup / SelectGroupLabel / SelectSeparator | grouping | — | Optional sectioning within the list. |