Zazz Design Framework
Components

Menu

Popover menus using the Popover API, anchor positioning, and native light dismiss, with optional hover open and arrow-key navigation.

A <ui-menu> wraps a trigger button (popovertarget) and its [data-slot="menu-popover"] panel (popover="auto"). The class form <div class="ui-menu"> is equivalent and needs no JavaScript. The root names the trigger plus panel assembly, while the native <menu> element remains the list inside the panel. Menu items use ghost buttons. Position the panel with data-side and data-align.

When the kit script is loaded, the tag form adds arrow-key navigation: ArrowDown/ArrowUp on the closed trigger opens the panel and focuses the first or last item. Inside the panel, arrow keys navigate between items (wrapping and skipping disabled items), and Home/End jump to the ends. Escape and light dismiss remain standard Popover API behavior.

Default

Loading components…

Hover open

Add interestfor alongside popovertarget (pointing to the same panel id) to open the menu on hover, focus, or long-press via the Interest Invokers API. Clicking still toggles, and popover="auto" maintains light dismiss.

Loading components…

Accessibility

The menu is a disclosure pattern of links and buttons rather than an ARIA role="menu". The menu role carries a strict menu keyboard contract (menuitem roles, typeahead, close-on-activate) meant for desktop app toolbars rather than website navigation. popovertarget already communicates expanded and collapsed state to assistive technology. If every item in your panel represents an application action, you can add role="menu" and role="menuitem" attributes directly.

API

AttributeTargetValues
popovertargetTriggerID of [data-slot="menu-popover"] (click toggle)
interestforTriggerSame ID: adds hover/focus open (optional)
data-side[data-slot="menu-popover"]top, bottom, left, right
data-align[data-slot="menu-popover"]start, center, end

On this page