| idPrefixrequired | string | — | Prefix for generating aria-activedescendant IDs. By default, each option uses id="${idPrefix}-${encodeURIComponent(itemId)}" via getEncodedListboxItemId; pass getItemId to use a different encoding. |
| autoFocus | boolean | false | Focus the container on mount and initialize highlight to the selected item or first navigable item for the active role. |
| selectedId | string | null | — | Controlled selected item ID. When provided, the hook is in controlled mode for selection. |
| defaultSelectedId | string | null | null | Initial selected item ID for uncontrolled mode. |
| highlighted | string | null | — | Controlled highlighted item ID. When provided, the hook is in controlled mode for highlight. |
| defaultHighlighted | string | null | null | Initial highlighted item ID for uncontrolled mode. |
| onSelect | (id: string) => void | — | Called when an item is activated by click, Space, or Enter, including re-activating the already-selected item. |
| onEnter | (id: string, event: KeyboardEvent) => void | — | Called when Enter activates the highlighted item. Selection is committed before this callback runs. |
| onHighlightChange | (id: string | null) => void | — | Called when the highlighted item changes via keyboard navigation or is cleared. |
| onNavigationBoundaryReached | (direction: "previous" | "next", event: KeyboardEvent, key: string) => void | — | Called when wrap is false and keyboard navigation attempts to move before the first item or after the last item. Receives the direction, the originating keyboard event, and the key that hit the boundary. |
| wrap | boolean | true | Whether keyboard navigation wraps from last item to first (and vice versa). |
| onKeyDown | (event: KeyboardEvent) => void | — | Additional keydown handler called before the built-in navigation handler. Call event.preventDefault() to suppress default keyboard navigation. |
| role | "listbox" | "menu" | "listbox" | ARIA role for the container element. |
| itemRole | "option" | "menuitem" | "menuitemradio" | "option" | ARIA role for each item element. |
| typeahead | boolean | false | Enable type-ahead character search to jump to matching items. |
| items | ListboxMetadataItem[] | — | Optional metadata array describing each item ({ id, disabled? }). It helps validate active descendants and initial highlight, while keyboard navigation and typeahead still inspect the mounted DOM items. |
| getItemId | (idPrefix: string, id: string) => string | getEncodedListboxItemId | Override how option DOM ids are derived from idPrefix and the item's logical id. Defaults to URL-encoding the id; supply a custom encoder if your option ids must follow a different scheme (e.g. when consuming externally indexed nodes). |
| ref | Ref<HTMLDivElement> | — | External/forwarded ref for the container. Composed once with the internal ref so getContainerProps returns a stable ref callback (pass a stable ref, e.g. from useComposedRefs, to avoid detach/re-attach). |