Module / v1.0.0-beta.13

@typed/ui/Listbox

11 unique exports available through this public import path, including their members and aliases.

Learn this UI primitive →

import * as Listbox from "@typed/ui/Listbox";

Listbox surface

  • Root

    function

    Renders the listbox root, initializes selection on focus, and handles vertical movement and typeahead in DOM order.

  • RootOptions

    interface

    Inputs accepted by Listbox.Root in addition to the shared DOM host options.

Option registration

Selectable options

  • Option

    function

    Renders and optionally registers an option; focus or click selects it unless disabled.

  • OptionOptions

    interface

    Inputs accepted by Listbox.Option in addition to the shared DOM host options.

Selection and focus

  • InitialState

    interface

    Initial Listbox values. value and activeId default to null, loop defaults to true, and roving focus is used.

  • State

    interface

    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.

  • StateSchema

    variable

    Effect Schema used by makeState to encode, decode, and hydrate Listbox state.

  • makeState

    function

    Creates hydrated Listbox state. value and activeId default to null, loop defaults to true, and roving focus is used.

  • move

    function

    Moves through the registered options, synchronizes value when the target has one, then focuses and scrolls the active option.

  • select

    function

    Sets both activeId and selected value in one update.