createSelectableCollectionNavigation
Add accessible keyboard navigation (arrow keys, Home/End, RTL) for tabs, radio groups, and listboxes.
createSelectableCollectionNavigation provides keyboard navigation (Arrow Up/Down/Left/Right, Home, End) and activation modes for selectable item collections like Tabs, Radio Groups, and Listboxes.
Import#
Signature#
Usage Example#
src/CustomTabs.tsx
Key Bindings#
- ArrowLeft / ArrowRight: Move previous / next in horizontal collections (respects RTL).
- ArrowUp / ArrowDown: Move previous / next in vertical collections.
- Home / End: Jump directly to first / last enabled item.
- Automatic vs Manual: In
automaticmode, navigation selects immediately. Inmanualmode, pressing Enter or Space confirms selection.