Zazz Design Framework
Components

Mobile menu

Full-screen slide-in navigation dialog with nested accordion sections, using native HTML APIs.

The mobile menu composes a native <dialog> with nested <details> accordions. Open it with command="show-modal" and commandfor="<id>", close with command="close" or light-dismiss via closedby="any". No JavaScript needed.

Internally it uses .dialog[data-size="screen"] for full-viewport coverage and data-animation="slide-right" for the entrance transition.

Default

Loading components…

Structure

<!-- Trigger -->
<button class="button" data-size="icon" command="show-modal" commandfor="mobile-menu-1">☰</button>

<!-- Menu -->
<dialog
  id="mobile-menu-1"
  class="dialog mobile-menu"
  data-size="screen"
  data-animation="slide-right"
  closedby="any"
>
  <div class="mobile-menu__viewport">
    <div class="mobile-menu__header">…</div>
    <div class="mobile-menu__body">
      <div class="accordion">
        <details>
          <summary class="button" data-variant="ghost">Section</summary>
          <div class="flex flex-col pb-sm">
            <!-- Links / nested accordions -->
          </div>
        </details>
      </div>
    </div>
    <div class="mobile-menu__footer">…</div>
  </div>
</dialog>

Tokens

TokenDefault
--mobile-menu-backgroundvar(--background)
--mobile-menu-foregroundvar(--foreground)
--mobile-menu-backdropvar(--faded-foreground)
--mobile-menu-header-padding-inlinevar(--gap-md) var(--gap-xs)
--mobile-menu-header-padding-blockvar(--gap-xs)
--mobile-menu-body-padding-inlinevar(--gap-sm)
--mobile-menu-body-padding-blockvar(--gap-md)
--mobile-menu-footer-paddingvar(--gap-sm)
--mobile-menu-footer-gapvar(--gap-xs)
--mobile-menu-nested-accordion-padding-inline-startvar(--gap-sm)

API

AttributeWhereValues
commandtriggershow-modal, close
commandfortriggerid of the <dialog>
data-size.mobile-menuscreen
data-animation.mobile-menuslide-right
closedby<dialog>any, closerequest, none

Composition notes

  • Add .dark to the dialog for a dark-themed menu regardless of page theme.
  • The body uses a nested .accordion with native <details> for expand/collapse sections.
  • Nested accordions (accordion inside accordion) automatically indent via --mobile-menu-nested-accordion-padding-inline-start.
  • The header and footer are position: sticky so they remain visible while the body scrolls.
  • Use .button[data-variant="ghost"] for nav links inside accordion panels.

On this page