Select
Choose one item from a non-editable collection.
Use Select for one choice from a non-editable collection. Use Combobox when users need to type a query, or BaseSelect when you need to compose the listbox yourself.
Basic usage#
Playground#
Anatomy#
Select renders the portaled popup collection internally; its slots are styling targets. Use BaseSelect to compose the listbox yourself.
Usage#
String items#
Pass strings when the label and value are identical. Strings and objects can be mixed at the root or inside a group. Whitespace is preserved, and an empty string is a valid value.
String items are converted to the same item shape used by callbacks: 'Apple' becomes
{ value: 'Apple', label: 'Apple' }. Object items retain their identity and custom fields.
SelectT.NormalizedItem<TItem> names the callback item type. Duplicate values use the first
occurrence, including collisions between strings and objects.
Value and collection#
The value slot shows the selected label or String(value) for an unresolved value. Clear is a pointer-only action inside the trigger that clears selection without toggling the popup.
Pair value with onValueChange for controlled selection, or use defaultValue for an initial
uncontrolled choice. null means no selection; an empty string is a valid item value. Use unique
item values so each selection identifies one option.
Printable keys perform rapid typeahead navigation across available options without opening an editable input.
Keyboard interaction#
| Key | Behavior |
|---|---|
| Enter / Space | Open the popup or commit the active option |
| ArrowDown / ArrowUp | Open or move through selectable options |
| Home / End | Move to the first or last option while open |
| Printable key | Typeahead to the matching item label |
| Escape | Close the dropdown without changing the value |
Examples#
Rich items#
Each item supports an icon and secondary description without requiring custom item templates.
Team roles#
Grouped options#
Organize options into labeled categories using type: 'group'. Insert { type: 'separator' } between groups or items to show a divider. Labels and separators are excluded from selection and keyboard navigation.
Incremental collections#
Use onScrollBottom and scrollBottomThreshold to load additional pages of options as the user scrolls.
Form integration#
For an empty form.Field-bound Select, initialize the field with null and accept null in the schema.
Attributes#
data-closedSlot: select-control, select-content, select-triggerDescription: Present when disclosure or transition content is closed.data-disabledSlot: select-control, select-item, select-triggerDescription: Present when the component, slot, or item is disabled.data-expandedSlot: select-control, select-content, select-triggerDescription: Present when the panel, accordion, or menu is expanded.data-invalidSlot: select-control, select-triggerDescription: Present when the field or form has a validation error.data-readonlySlot: select-controlDescription: Present when the field is in read-only mode.data-requiredSlot: select-controlDescription: Present when the field input is required.data-sideSlot: select-contentDescription: Stores the resolved floating or drawer content side.data-highlightedSlot: select-item, select-item-descriptionDescription: Present when the item is highlighted by pointer or keyboard navigation.data-selectedSlot: select-itemDescription: Present when the item or tab is selected.data-loadingSlot: select-trailingDescription: Present when the component or async operation is loading.data-placeholderSlot: select-valueDescription: Present while placeholder content is displayed.Props#
Renders a <div> element by default.