Horizontal menubar keyboard navigation? #2872
-
Hi team! I'm working on a responsive navbar that lays out horizontally on desktop and vertically on mobile using @react-aria/menu. So far so good, but I'm wondering if there's a way to configure the keyboard navigation to navigate with left/right keys when the menu is in its desktop orientation, as opposed to (or in addition to) up/down keys. Or maybe there's a better primitive for building responsive navbars that I should be using instead? I tried to look for references around orientation on the docs and in the repo but have come up empty so far. Any ideas would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Is it a menu? or would TabList make more sense? Or maybe the ActionGroup? Otherwise, if it truly is a menu/nav, you can probably use the keyboardDelegate to implement it. The types for it are in the props args of useMenu here https://react-spectrum.adobe.com/react-aria/useMenu.html |
Beta Was this translation helpful? Give feedback.
Is it a menu? or would TabList make more sense? Or maybe the ActionGroup?
Otherwise, if it truly is a menu/nav, you can probably use the keyboardDelegate to implement it. The types for it are in the props args of useMenu here https://react-spectrum.adobe.com/react-aria/useMenu.html