Skip to content

Navigation

Navigation primitives for the page. The cui-navbar element handles a sticky top bar with responsive collapse, dropdown menus, and nested submenus; the cui-sidenav element handles a vertical side rail that collapses to an icon-only mini-rail and hides off-canvas on mobile. Both leave their links and buttons in light DOM.

Sidenav

A vertical side rail for dashboard layouts. It collapses to an icon-only mini-rail on wide viewports and hides off-canvas behind a backdrop below 48rem. The cui-sidenav element injects the collapse toggle, the mobile dismiss button, and the backdrop, and wires up the focus trap, scroll lock, and ARIA.

Toggle menu

Resize below 48rem: "Toggle menu" opens the rail as an off-canvas drawer. At wider widths the collapse button in the header shrinks it to a mini-rail.

API reference
Attribute / property Purpose
expanded Boolean. Off-canvas drawer state below 48rem. Opened by a remote trigger, closed by the dismiss button, backdrop click, or Esc.
collapsed Boolean. Icon-only mini-rail state at ≥48rem. Toggled by the injected collapse button.
side start (default) or end. Docks the rail and slides the mobile drawer from that side.
sticky · sticky-offset · sticky-z-index Pins the rail full-height at ≥48rem, with a top offset and drawer stacking order.
sidenav.toggle(force?) / open() / close() Open / close the off-canvas drawer.
sidenav.collapse(force?) Collapse / expand the mini-rail.
Markup class Purpose
.cui-sidenav-inner The visible rail surface (background, divider border, padding); stacks the header, nav, and footer.
.cui-sidenav-header / .cui-sidenav-brand / .cui-sidenav-logo Top row with the brand lockup; the element appends the collapse toggle and dismiss button here.
.cui-sidenav-nav + .cui-nav-link The scrollable link column. Reuses the .cui-nav-link primitive; pair with aria-current="page" for the active item.
.cui-sidenav-icon / .cui-sidenav-label Per-link leading icon and text label. Every .cui-sidenav-label hides in the collapsed mini-rail.
.cui-sidenav-footer Action stack pinned to the bottom of the rail; collapses out of flow when empty.
data-cui-sidenav-target="<id>" Put on any button to open the matching sidenav's mobile drawer from elsewhere on the page.
Variable Default
--cui-sidenav-width 16rem
--cui-sidenav-collapsed-width 4.5rem
--cui-sidenav-bg --cui-color-surface-raised
--cui-sidenav-border --cui-color-border
--cui-sidenav-backdrop rgb(0 0 0 / 40%)
--cui-sidenav-z-index 50
--cui-sidenav-sticky-offset 0
--cui-sidenav-animation-duration · --cui-sidenav-animation-easing Drawer / collapse motion.