Sidebar navigation
BetaNavigationOpen in the workshop
The admin panel’s main navigation: brand, sections, account, collapse.
nav.xg-sidebar (#id) > .xg-sidebar__brand + a.xg-nav-item[aria-current] (svg + span + .xg-count) + .xg-sidebar__section + .xg-sidebar__footer · .is-collapsed · [data-xg-collapse="id"]Example and markup
Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.
Markup
<div style="height:520px;display:flex;border:1px solid var(--xg-color-border-default);border-radius:var(--xg-radius-card);overflow:hidden;background:var(--xg-color-bg-page)">
<nav class="xg-sidebar" id="nav-cmp" aria-label="Main">
<div class="xg-sidebar__brand">
<img data-xg-logo="horizontal" src="/brand/xendiz/logo/xendiz-horizontal-on-light.svg" alt="Xendiz" height="26">
<img class="xg-brand-mark" data-xg-logo="mark" src="/brand/xendiz/logo/xendiz-mark-on-light.svg" alt="" height="28">
</div>
<a class="xg-nav-item" href="#" aria-current="page">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<rect x="3" y="3" width="7" height="9" rx="1.5"/>
<rect x="14" y="3" width="7" height="5" rx="1.5"/>
<rect x="14" y="12" width="7" height="9" rx="1.5"/>
<rect x="3" y="16" width="7" height="5" rx="1.5"/>
</svg>
<span>Dashboard</span>
</a>
<a class="xg-nav-item" href="#">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M3 11v2a1 1 0 0 0 1 1h2l5 4V6L6 10H4a1 1 0 0 0-1 1Z"/>
<path d="M15.5 8.5a5 5 0 0 1 0 7"/>
<path d="M18.5 5.5a9 9 0 0 1 0 13"/>
</svg>
<span>Campaigns</span>
<span class="xg-count" aria-label="3 need review">3</span>
</a>
<a class="xg-nav-item" href="#">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M3 7l9-4 9 4-9 4-9-4Z"/>
<path d="M3 12l9 4 9-4"/>
<path d="M3 17l9 4 9-4"/>
</svg>
<span>Inventory</span>
</a>
<a class="xg-nav-item" href="#">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<circle cx="9" cy="8" r="3.5"/>
<path d="M2.5 20a6.5 6.5 0 0 1 13 0"/>
<circle cx="17.5" cy="9" r="2.5"/>
<path d="M16 14.2a5 5 0 0 1 6 4.8"/>
</svg>
<span>Demand partners</span>
</a>
<a class="xg-nav-item" href="#">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M4 20V10"/>
<path d="M10 20V4"/>
<path d="M16 20v-7"/>
<path d="M22 20H2"/>
</svg>
<span>Reports</span>
</a>
<a class="xg-nav-item" href="#">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M8 6h13"/>
<path d="M8 12h13"/>
<path d="M8 18h13"/>
<path d="M3 6h.01"/>
<path d="M3 12h.01"/>
<path d="M3 18h.01"/>
</svg>
<span>Request logs</span>
</a>
<div class="xg-sidebar__section">Account</div>
<a class="xg-nav-item" href="#">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M3 7.5A2.5 2.5 0 0 1 5.5 5H18a1 1 0 0 1 1 1v2"/>
<rect x="3" y="7.5" width="18" height="12.5" rx="2.5"/>
<path d="M16.5 14h.01"/>
</svg>
<span>Billing</span>
</a>
<a class="xg-nav-item" href="#">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<circle cx="12" cy="12" r="3"/>
<path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"/>
</svg>
<span>Settings</span>
</a>
<div class="xg-sidebar__footer">
<button class="xg-nav-item" type="button" data-xg-collapse="nav-cmp" aria-expanded="true" aria-label="Collapse navigation" style="border:0;background:none;cursor:pointer;width:100%">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<rect x="3" y="4" width="18" height="16" rx="2.5"/>
<path d="M9 4v16"/>
</svg>
<span>Collapse</span>
</button>
</div>
</nav>
</div>States
Hover, focus and pressed are forced here with .is-hover, .is-focus and .is-active so they can be seen side by side; in a product they come from :hover, :focus-visible and :active.
| State | Nav item |
|---|---|
| Default | |
| Hover | |
| Focus | |
| Current | |
| With count |
When to use it
Use it for
every authenticated screen of the platform.
Not for
marketing pages; more than about nine top-level items.
Rules
- Order follows the daily job: Dashboard, Campaigns, Inventory, Demand partners, Reports, Request logs; then Account.
- One item is current; its icon and text take primary-ink on the selected tint.
- Counts only for things that need action (“3 in review”), in the error fill.
- Collapsed width 72 px keeps icons; the brand shows the mark. WaardeX has no 2026 mark file yet, so its slot stays empty when collapsed (see Brand → Logo → Missing).
- Below 900 px the sidebar becomes a menu behind the topbar button.
Accessibility
- <nav aria-label="Main">, links with aria-current="page"; collapsed items keep their text for screen readers via aria-label if you hide the span.
Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.
Related
Also in Navigation: Topbar, Tabs, Breadcrumb, Wizard steps, Dropdown menu. Used in the patterns Dashboard.
Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).