Forms
ISelect
A listbox driven by an items array, with keyboard navigation and typeahead. For a list long enough that typing beats scrolling, use ICombobox.
Strings as items
A plain string is expanded to { label: value, value }.
Groups
An item with its own items becomes a labelled run of options under a heading.
Sizes
Disabled
Disable the whole control, or a single option with disabled on the item — "Net 60 days" above is disabled that way.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | (SelectItemOption | SelectItemGroup | string)[] | [] | Options to render |
placeholder | string | — | Shown while nothing is selected |
size | 'sm' | 'md' | 'lg' | 'md' | Control scale |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Merged with the built-in classes |
ui | { trigger?, content?, viewport?, item?, group?, groupLabel? } | — | Per-slot class overrides |
disabled, required, name and dir are forwarded to Reka UI's SelectRoot.
Item shapes
ts
interface SelectItemOption {
label: string
value: string
disabled?: boolean
}
interface SelectItemGroup {
label: string
items: (SelectItemOption | string)[]
}Attributes you set land on the trigger, so aria-label names the button the reader operates.