UseListboxNavOptions
Defined in: src/hooks/useListboxNav/useListboxNav.ts:9
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”defaultActiveIndex?
Section titled “defaultActiveIndex?”
optionaldefaultActiveIndex?:number
Defined in: src/hooks/useListboxNav/useListboxNav.ts:20
Initial active index. Defaults to -1 (no active item).
isItemDisabled?
Section titled “isItemDisabled?”
optionalisItemDisabled?: (item,index) =>boolean
Defined in: src/hooks/useListboxNav/useListboxNav.ts:17
Whether a given item should be skipped during navigation and rejected by
selectActive().
Parameters
Section titled “Parameters”T
number
Returns
Section titled “Returns”boolean
items:
T[]
Defined in: src/hooks/useListboxNav/useListboxNav.ts:11
Items rendered in the listbox. The hook tracks navigation by index.
optionalloop?:boolean
Defined in: src/hooks/useListboxNav/useListboxNav.ts:26
Wrap from last → first (and vice versa) on next/prev.
Default
Section titled “Default”trueonEscape?
Section titled “onEscape?”
optionalonEscape?: () =>void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:39
Called on Escape.
Returns
Section titled “Returns”void
onSelect?
Section titled “onSelect?”
optionalonSelect?: (item,index) =>void
Defined in: src/hooks/useListboxNav/useListboxNav.ts:36
Called when the active item is committed via selectActive().
Parameters
Section titled “Parameters”T
number
Returns
Section titled “Returns”void
resetOnItemsChange?
Section titled “resetOnItemsChange?”
optionalresetOnItemsChange?:boolean
Defined in: src/hooks/useListboxNav/useListboxNav.ts:33
Reset the active index when the items array changes by reference. Useful for filtered listboxes where the previous index would be stale.
Default
Section titled “Default”true