useVirtualFocus API
API reference for the useVirtualFocus composable.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| useVirtualFocus | System |
| Combobox | Forms |
| useRovingFocus | System |
| useEventListener | System |
| createSingle | Selection |
Functions
useVirtualFocus
(items: () => VirtualFocusItem[], options: VirtualFocusOptions) => VirtualFocusReturnOptions
control required
MaybeRefOrGetter<HTMLElement | null | undefined>Element that retains DOM focus and receives aria-activedescendant
target
MaybeRefOrGetter<HTMLElement | null | undefined>Element to attach keydown listener to (defaults to control)
orientation
"horizontal" | "vertical" | "both" | undefinedArrow key mapping. Ignored when `columns` is set (grid uses all 4 arrows).
circular
boolean | undefinedcolumns
MaybeRefOrGetter<number> | undefinedColumn count for grid navigation. When set, items are treated as a 2D grid in row-major order: Left/Right step +/-1, Up/Down step +/-columns, Home/End go to row start/end, Ctrl+Home/End go to first/last overall.
onHighlight
((id: ID) => void) | undefinedProperties
highlightedId
ShallowRef<ID | undefined>