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