# useVirtualFocus API

> Auto-generated API reference for `useVirtualFocus` from @vuetify/v0 (Vuetify0).
> Source of truth: https://0.vuetifyjs.com/api/use-virtual-focus

## Related

- https://0.vuetifyjs.com/composables/system/use-virtual-focus
- https://0.vuetifyjs.com/components/forms/combobox
- https://0.vuetifyjs.com/composables/system/use-roving-focus
- https://0.vuetifyjs.com/composables/system/use-event-listener
- https://0.vuetifyjs.com/composables/selection/create-single

## Functions

### useVirtualFocus

```ts
(items: () => VirtualFocusItem[], options: VirtualFocusOptions) => VirtualFocusReturn
```

## Options

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `control` | `MaybeRefOrGetter<HTMLElement \| null \| undefined>` | — | yes | Element that retains DOM focus and receives aria-activedescendant |
| `target` | `MaybeRefOrGetter<HTMLElement \| null \| undefined>` | — | no | Element to attach keydown listener to (defaults to control) |
| `orientation` | `"horizontal" \| "vertical" \| "both" \| undefined` | — | no | Arrow key mapping. Ignored when `columns` is set (grid uses all 4 arrows). |
| `circular` | `boolean \| undefined` | — | no | — |
| `columns` | `MaybeRefOrGetter<number> \| undefined` | — | no | Column 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) \| undefined` | — | no | — |

## Methods

| Name | Type | Description |
|---|---|---|
| `highlight` | `(id: ID) => void` | — |
| `clear` | `() => void` | — |
| `next` | `() => void` | — |
| `prev` | `() => void` | — |
| `first` | `() => void` | — |
| `last` | `() => void` | — |
| `onKeydown` | `(e: KeyboardEvent) => void` | — |

## Properties

| Name | Type | Description |
|---|---|---|
| `highlightedId` | `ShallowRef<ID \| undefined>` | — |
