Site color

Choose your site’s color palette.

Saved on this device.

NavMenu

NavMenuPrepared navigation

A hierarchical site navigation panel with active-page state, collapsible groups and optional search and account controls.

Site navigation & services

Playground

Switch between a documentation tree and an application menu, then pick the current page. The current page is marked for assistive technology and every group above it opens. Choose a link in the menu to move there; the playground keeps links on this page. Glass reads best on the spotlight backdrop it was designed for.

From site config

The menu the doc layout docks in its sidebar takes its tone, variant and extra classes from the navigation section of siteConfig.json. A page can still override the tone with nav.tone in its frontmatter.

{
  "navigation": {
    "tone": "accent",
    "variant": "glass",
    "class": "spotlight-from-top-right"
  }
}

Docked in the sidebar, the menu stays square and borderless whatever the variant, so the variant sets its fill and colors.

Your own items

Pass items to show a tree that is not the site navigation, and currentUrl to say which page is current. Without currentUrl, NavMenu uses the page being rendered, then the browser location. Groups are items with children; a group can have its own url too.

<NavMenu
  currentUrl="/app/billing/invoices/"
  variant="surfaceAlt"
  :items="[
    { title: 'Dashboard', url: '/app/', icon: 'tabler:layout-dashboard' },
    {
      title: 'Billing',
      icon: 'tabler:credit-card',
      children: [
        { title: 'Invoices', url: '/app/billing/invoices/' },
        { title: 'Plans', url: '/app/billing/plans/' },
      ],
    },
  ]"
/>

In a client-side app, pass a shallow sref for items and a ref for currentUrl. The menu redraws when either changes. A deep ref would turn every item into a ref of its own.

Docked in the doc layout

This ordinary page uses the standard documentation template, which renders the site's navigation with its configured appearance and runtime. The narrow iframe uses the mobile layout: open the menu with the header's navigation toggle. Open the full page in a wide window to try desktop sidebar collapse, restore, and resizing. Links open the real guides within the preview.

Open the full-page layout preview

All ten semantic tones

All supported values are visible together on the actual component, in an isolated document.

All ten semantic tonesCOMPOSITION

Samples follow this guide’s theme. Service appearance comparisons do not register account, search, or consent services.

All eighteen visual variants

All supported values are visible together on the actual component, in an isolated document.

All eighteen visual variantsCOMPOSITION

Samples follow this guide’s theme. Service appearance comparisons do not register account, search, or consent services.

Both variant modes

Compare stateless and stateful outlineFill treatments. Hover the samples; a stateful surface does not create new application behavior.

Both variant modesCOMPOSITION

Samples follow this guide’s theme. Service appearance comparisons do not register account, search, or consent services.

Feature comparisons

Every configuration in viewCOMPOSITION

Each labelled sample exposes a different public feature or site configuration. Account states are presentation examples.

The comparisons show an active child with its open ancestor, a closed inactive group, icon-bearing leaf links, and site-configured search and account controls. Use the existing playground to switch the current page, tree, icons, tone, variant, and mode. Group summaries are native disclosure controls.

Feature map

Feature Where to explore it
Active paths, open ancestors, hierarchy, and site controls Context preview, feature comparisons, and original copyable source examples.
Public appearance options Complete galleries above. Only options supported by this component are shown.
Native semantics and integration Behavior notes and API contracts below explain the component’s roots, slots, and runtime dependencies.

Behavior and accessibility

NavMenu is a nav landmark labelled “Site navigation”. The current page’s link carries aria-current="page" and every group above it starts open. Groups are native details and summary, so they open and close from the keyboard without script, and visitors who never run script still see the whole tree.

With the standard navigation runtime, a menu remembers which groups were open and where it was scrolled. Docked in the doc layout’s sidebar, it also gains the layout controls: collapsing to a rail, reopening as a floating panel, and dragging its edge to resize. A menu anywhere else, like the one in the playground, stays plain navigation and never changes the page layout.

Use NavList when you already have prepared row state and need only the list.

API reference

NavMenu contract

Items, current page, tone and treatment are reactive. The SSG context supplies the default navigation, current URL, search configuration and authentication configuration.

Composition

No slots. Register defineNavigationComponents with BtnLink, Icon, SignIn and SearchBox dependencies. NavItem is an internal row component that reads its item from the surrounding list context.