Listbox surface
Rootfunction
Renders the listbox root, initializes selection on focus, and handles vertical movement and typeahead in DOM order.
RootOptionsinterface
Inputs accepted by Listbox.Root in addition to the shared DOM host options.
Option registration
makeCollectionvariable
Creates a scoped Collection for Listbox items.
Selectable options
Optionfunction
Renders and optionally registers an option; focus or click selects it unless disabled.
OptionOptionsinterface
Inputs accepted by Listbox.Option in addition to the shared DOM host options.
Selection and focus
InitialStateinterface
Initial Listbox values. value and activeId default to null, loop defaults to true, and roving focus is used.
Stateinterface
The committed single value and the option currently owning keyboard focus. Normal option focus and movement update both values; the DOM ID and saved value may differ.
StateSchemavariable
Effect Schema used by makeState to encode, decode, and hydrate Listbox state.
makeStatefunction
Creates hydrated Listbox state. value and activeId default to null, loop defaults to true, and roving focus is used.
movefunction
Moves through the registered options, synchronizes value when the target has one, then focuses and scrolls the active option.
selectfunction
Sets both activeId and selected value in one update.