R

RovingFocus

2 parts

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
import {
  RovingFocusItem,
  RovingFocusGroup,
} from '@robonen/primitives/roving-focus';

<RovingFocusItem>
  <RovingFocusGroup />
</RovingFocusItem>

API Reference

RovingFocusItem

Item
PropTypeDescription
tabStopId?stringUnique tab-stop id. Auto-generated via config `useId` when omitted.
focusable?booleanWhether this item is focusable.
active?booleanMarks the item as active (current selection).
allowShiftKey?booleanAllow `Shift+Arrow` for navigation.

RovingFocusGroup

Group
PropTypeDescription
orientation?OrientationNavigation orientation — decides which arrow keys move focus.
dir?DirectionWriting direction (LTR / RTL). Falls back to `useConfig().dir`.
loop?booleanWrap around at the ends.
currentTabStopId?string | nullControlled current tab-stop id.
defaultCurrentTabStopId?stringInitial current tab-stop id (uncontrolled).
preventScrollOnEntryFocus?booleanPrevent scroll when focus enters the group.