Hololink UI is under active development. Components, APIs and these docs may change without notice.
Holo Menu & Menu Item
<holo-menu> is a popup menu built on the native Popover API (like <holo-popover>). Put a
trigger element in the trigger slot and <holo-menu-item> children in the default slot. Arrow
keys / Home / End move focus between items, Enter/Space activates the focused item, and Esc closes
the menu and returns focus to the trigger.
The menu uses the Popover API (popover="auto") on an element with role="menu". Each <holo-menu-item> sets role="menuitem" on itself and takes tabindex="-1". The trigger goes in the trigger slot. The component sets aria-haspopup="menu" on it (unless you already set one) and keeps aria-expanded in sync.
Key
Action
Enter, Space
On a button trigger, opens the menu (native click). On an item, selects it
ArrowDown
On the trigger: opens the menu and focuses the first item. In the menu: next item (wraps)
ArrowUp
On the trigger: opens the menu and focuses the last item. In the menu: previous item (wraps)
Home
Focuses the first item
End
Focuses the last item
Esc
Closes the menu and returns focus to the trigger
When the menu opens, focus moves to the first enabled item. When it closes, focus returns to the trigger.
Items use roving tabindex: only the focused item has tabindex="0".
Disabled items set aria-disabled="true" and are skipped by arrow-key navigation.
Selecting an item emits holoMenuSelect, then closes the menu. Clicking outside also closes it (native light dismiss).
There is no type-ahead (jumping by typed letter) and no support for submenus or checkable items.
The open and close transition only runs when prefers-reduced-motion: no-preference.
You provide:
A trigger that is a focusable, named control, normally a Button or Icon Button with a clear label.