Select
A selection list: a clickable set of options — the inner list of floating components like Dropdown, and usable on its own. The option data contract is in Selection and options.
Matching the original SelectWidget, this component's root is not focusable by default (it is not in the Tab order), so it is best suited to mouse selection. For keyboard-reachable single or multiple selection, prefer components that handle focus for you — Dropdown, RadioSelect, ButtonSelect — all of which use Select as their inner list. As a menu's inner layer, keyboard navigation is handled by the outer trigger for you, so you don't have to manage it.
Basic usage
onChange and onChoose
The two "choose" callbacks have different roles:
onChange: fires when the selected value changes; re-clicking the current item doesn't fire it.onChoose: fires on every choice (click / drag / Enter), including repeats. Floating components use it to "close on choose".
Command-menu form
When clearOnChoose is true, a choice only fires onChoose and doesn't change the selected value — a "selected" state never appears, which suits command menus that run an action and keep no selection.
Group headings
Items in the options array without a value render as group headings — not selectable and skipped by keyboard navigation.
Keyboard navigation switches
As a menu's inner layer, keyboard navigation is driven by the outer component. For the standalone case where the list has focus:
handleNavigationKeys: whether Home / End / PageUp / PageDown are handled (matching the original, onlyMenuSelectWidgetenables it).listWrapsAround: whether arrow navigation wraps at the ends (defaulttrue).
API
There is no children slot; every option is declared through options.
See also
- Option data and the keyboard focus model: Selection and options
- Floating components that use Select as their inner list: Dropdown
- The division of labor between
onChangeandonChoose: Controlled and uncontrolled