Skip to content

Navigation Menu ​

ore-navigation-menu groups disclosure buttons with non-modal panels of navigation links. It does not create a navigation landmark; place it inside the page's existing navigation landmark, such as ore-navbar.

Basic usage ​

Full width

Use ore-navigation-menu-link for links styled for the panel. Native anchors also work. Mark the current destination with active; the built-in link exposes aria-current="page" on its native anchor.

Grouped content ​

Panels use a content-sized grid. columns is the maximum column count; columns also adapt to the available panel width and --navigation-menu-column-min. Keep each visual group in one direct child so its content flows independently:

Full width

Responsive layout ​

Inside ore-navbar, the menu automatically switches to inline disclosure panels when the navbar enters its mobile layout. Use the inline attribute to opt into the same document-flow layout outside a navbar. Inline panels render as a single column and remain associated with their trigger.

Keyboard and accessibility ​

  • Each item is a button with aria-expanded; its panel is a labelled region.
  • Arrow keys move among triggers in the writing direction. Home and End move to the first and last enabled trigger.
  • ArrowDown opens the active panel and moves focus to its first focusable item.
  • Tab from an open trigger enters the panel; Shift+Tab from its first item returns to the trigger. Tab from the last panel item moves to the next trigger when one exists.
  • Escape closes the active panel and restores trigger focus. Moving focus outside the active trigger and panel also closes it.

API reference ​

ore-navigation-menu ​

AttributeTypeDefaultDescription
openstringunsetControlled active trigger value. User interaction emits an open-change request; update this value to apply it.
default-openstringunsetInitial active trigger value.
close-on-selectbooleantrueCloses the menu after activating a panel link.
columnsnumber2Maximum number of panel content columns.
inlinebooleanfalseRenders panels in document flow instead of the popover layer.
placement'bottom-start' | 'bottom-end''bottom-start'Panel placement relative to the active trigger.
disabledbooleanfalseDisables all triggers.

ore-navigation-menu-item ​

AttributeTypeDefaultDescription
valuestring''Unique value paired with a panel's for attribute.
activebooleanfalseApplies the active trigger appearance.
disabledbooleanfalseDisables this trigger.

ore-navigation-menu-panel ​

AttributeTypeDefaultDescription
forstringunsetValue of the associated menu item.

The panel has a default content slot and an optional footer slot. Add data-navigation-menu-keep-open to a link or its ancestor to prevent close-on-select from closing the panel.

AttributeTypeDefaultDescription
hrefstringunsetLink destination.
activebooleanfalseMarks the destination as the current page.
targetstringunsetBrowsing context for the destination.
relstringunsetRelationship between the current page and destination.

The select event detail contains the active panel's value and the link's resolved href. The open-change event reports the requested value, open state, and interaction reason.

Styling ​

Custom propertyDefaultPurpose
--navigation-menu-panel-width48remMaximum panel width.
--navigation-menu-panel-max-height42remMaximum panel height.
--navigation-menu-panel-columns2Maximum content column count when the columns attribute is unset.
--navigation-menu-column-min12remMinimum width used to fit panel columns.
--navigation-menu-trigger-gapvar(--size-1)Gap between triggers.
--navigation-menu-bgTheme surfacePanel background.
--navigation-menu-border-colorvar(--color-divider)Panel border color.
--navigation-menu-radiusvar(--rounded-lg)Panel corner radius.
--navigation-menu-shadowvar(--shadow-xl)Panel shadow.
--navigation-menu-backdrop-blurvar(--blur-xl)Panel backdrop blur.

Panels use the viewport for positioning, even inside a clipping or scrollable container. Opening and closing reuse the shared overlay motion tokens and reduced-motion behavior; see Motion Mode.

Controlled state ​

When you supply open, the parent owns the active value. Update it in response to open-change:

js
const menu = document.querySelector('ore-navigation-menu');

menu.addEventListener('open-change', (event) => {
  menu.open = event.detail.value ?? undefined;
});