Navigation
.nw-tabs
Section titled “.nw-tabs”Tabs follow the WAI-ARIA tabs pattern: a role="tablist" of role="tab" buttons and one role="tabpanel" per tab. The CSS keys on the roles and on aria-selected, so the markup is the API. Tabs switch panels with JavaScript; the CSS hides panels that carry hidden.
<div class="nw-tabs" data-tabs> <div role="tablist" aria-label="Relay"> <button type="button" role="tab" id="t-load" aria-selected="true" aria-controls="p-load">Load <span class="nw-tab-count">12</span></button> <button type="button" role="tab" id="t-routes" aria-selected="false" aria-controls="p-routes" tabindex="-1">Routes</button> <button type="button" role="tab" id="t-log" aria-selected="false" aria-controls="p-log" tabindex="-1">Log</button> <button type="button" role="tab" id="t-locked" aria-selected="false" aria-controls="p-locked" tabindex="-1" disabled>Locked</button> </div> <div role="tabpanel" id="p-load" aria-labelledby="t-load" tabindex="0">Load: twelve metrics, sampled every second.</div> <div role="tabpanel" id="p-routes" aria-labelledby="t-routes" tabindex="0" hidden>Routes panel.</div> <div role="tabpanel" id="p-log" aria-labelledby="t-log" tabindex="0" hidden>Log panel.</div> <div role="tabpanel" id="p-locked" aria-labelledby="t-locked" tabindex="0" hidden>Locked.</div></div>| Selector / class | Effect |
|---|---|
nw-tabs |
The wrapper. The selected tab sits on a tonal wash in the intent ink. |
[role="tablist"], nw-tabs-list |
The row, or column when vertical, of tabs. |
[role="tab"], nw-tab |
A tab. |
[aria-selected="true"], [data-state="active"], nw-tab-active |
The selected tab. |
[role="tabpanel"], nw-tabs-panel |
A panel. Hidden while it has hidden or data-state="inactive". |
:disabled, [aria-disabled="true"] |
Dimmed, not clickable. |
nw-tab-icon |
Leading icon slot; mark it aria-hidden. |
nw-tab-count |
A small count chip inside a tab; it takes the intent ink on the selected tab. |
Variants and sizes
Section titled “Variants and sizes”<div class="nw-tabs nw-tabs-pill nw-tabs-sm" data-tabs> <div role="tablist" aria-label="Range"> <button type="button" role="tab" id="t-p1" aria-selected="true" aria-controls="p-p1">Day</button> <button type="button" role="tab" id="t-p2" aria-selected="false" aria-controls="p-p2" tabindex="-1">Week</button> <button type="button" role="tab" id="t-p3" aria-selected="false" aria-controls="p-p3" tabindex="-1">Month</button> </div> <div role="tabpanel" id="p-p1" aria-labelledby="t-p1" tabindex="0">Pill variant, small.</div> <div role="tabpanel" id="p-p2" aria-labelledby="t-p2" tabindex="0" hidden>Week.</div> <div role="tabpanel" id="p-p3" aria-labelledby="t-p3" tabindex="0" hidden>Month.</div></div><div class="nw-tabs nw-tabs-pill nw-tabs-cut nw-tabs-stretch nw-tabs-lg nw-tabs-secondary" data-tabs> <div role="tablist" aria-label="Journal"> <button type="button" role="tab" id="t-s1" aria-selected="false" aria-controls="p-s1" tabindex="-1">Map</button> <button type="button" role="tab" id="t-s2" aria-selected="true" aria-controls="p-s2">Journal</button> <button type="button" role="tab" id="t-s3" aria-selected="false" aria-controls="p-s3" tabindex="-1">Shards</button> </div> <div role="tabpanel" id="p-s1" aria-labelledby="t-s1" tabindex="0" hidden>Map.</div> <div role="tabpanel" id="p-s2" aria-labelledby="t-s2" tabindex="0">Pill, cut, stretch and large, in the secondary intent.</div> <div role="tabpanel" id="p-s3" aria-labelledby="t-s3" tabindex="0" hidden>Shards.</div></div><div class="nw-tabs nw-tabs-vertical" data-tabs> <div role="tablist" aria-label="Settings" aria-orientation="vertical"> <button type="button" role="tab" id="t-v1" aria-selected="true" aria-controls="p-v1">Audio</button> <button type="button" role="tab" id="t-v2" aria-selected="false" aria-controls="p-v2" tabindex="-1">Video</button> <button type="button" role="tab" id="t-v3" aria-selected="false" aria-controls="p-v3" tabindex="-1">Controls</button> </div> <div role="tabpanel" id="p-v1" aria-labelledby="t-v1" tabindex="0">Vertical tabs: the up and down arrows move the selection.</div> <div role="tabpanel" id="p-v2" aria-labelledby="t-v2" tabindex="0" hidden>Video.</div> <div role="tabpanel" id="p-v3" aria-labelledby="t-v3" tabindex="0" hidden>Controls.</div></div>| Class | Effect |
|---|---|
nw-tabs-pill |
A segmented control on a sunken track; the selected segment is solid and glows. |
nw-tabs-cut |
Folder tabs with the top-right corner chamfered; the selected tab is a solid intent panel. |
nw-tabs-vertical |
The list runs down the inline-start side. Set aria-orientation="vertical" on the tablist too. |
nw-tabs-stretch |
Tabs share the available width. |
nw-tabs-xs, -sm, -md, -lg |
Tab sizes. |
nw-tabs-primary … -danger |
The intent of the wash, the count and the selected segment. |
Link-based tabs
Section titled “Link-based tabs”The same look works for navigation between pages. nw-tabs-list is a plain container, nw-tab styles an <a> or <button>, nw-tab-active marks the current one and nw-tabs-panel wraps the content. Use aria-current="page" rather than the ARIA tab roles here, because the items are links.
<div class="nw-tabs"> <nav class="nw-tabs-list" aria-label="Relay docs"> <a class="nw-tab nw-tab-active" href="#link-based-tabs" aria-current="page">Overview</a> <a class="nw-tab" href="#link-based-tabs"><span class="nw-tab-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="9"/><path d="M12 8v4l3 2"/></svg></span>Metrics</a> <a class="nw-tab" href="#link-based-tabs" aria-disabled="true">Changelog</a> </nav> <div class="nw-tabs-panel">Link-based tabs navigate between pages instead of toggling panels.</div></div>Tab behavior script
Section titled “Tab behavior script”The CSS does not switch tabs. The demos on this page use a small delegated script (data-tabs on the wrapper) that sets aria-selected, the roving tabindex and the panels’ hidden, and handles the arrow, Home and End keys. In a framework, use the Vue components or your own state; the markup contract stays the same.
// Native behaviors for the plain-HTML component demos. The nw-* classes need none of this; it only// wires the platform features and the documented state attributes the markup relies on.export function bindNativeBehaviors() { document.addEventListener('click', (event) => { const target = event.target if (!(target instanceof Element)) return
// [data-open="#id"] opens a modal <dialog>; [data-close] closes the dialog it sits in. const opener = target.closest('[data-open]') if (opener) { const dialog = document.querySelector(opener.getAttribute('data-open')) if (dialog instanceof HTMLDialogElement && !dialog.open) dialog.showModal() return } const closer = target.closest('[data-close]') if (closer) { closer.closest('dialog')?.close() return }
// [data-toggle="#id"] flips aria-expanded on the trigger and data-state on the target, the // contract of the navbar collapse region and of collapsible sidenav groups. const toggle = target.closest('[data-toggle]') if (toggle) { const region = document.querySelector(toggle.getAttribute('data-toggle')) const open = toggle.getAttribute('aria-expanded') !== 'true' toggle.setAttribute('aria-expanded', String(open)) region?.setAttribute('data-state', open ? 'open' : 'closed') return }
// [data-toast="#template"] stamps the template's toast into the region that holds the template; // [data-dismiss] plays the toast's exit (data-state="closed") and removes it once it ends. const notifier = target.closest('[data-toast]') if (notifier) { const template = document.querySelector(notifier.getAttribute('data-toast')) if (template instanceof HTMLTemplateElement) { template.parentElement?.append(template.content.cloneNode(true)) } return } const toast = target.closest('[data-dismiss]')?.closest('.nw-toast') if (toast) { toast.setAttribute('data-state', 'closed') Promise.all(toast.getAnimations().map((animation) => animation.finished)).then(() => toast.remove(), ) } })
// Range inputs: WebKit and Blink have no progress pseudo-element, so the fill reads // --_slider-value. An <output for="id"> mirrors the value. const paintSlider = (slider) => { const min = Number(slider.min || 0) const max = Number(slider.max || 100) const percent = ((Number(slider.value) - min) / (max - min)) * 100 slider.style.setProperty('--_slider-value', `${percent}%`) for (const output of document.querySelectorAll('output')) { if (output.htmlFor.contains(slider.id)) output.value = slider.value } } for (const slider of document.querySelectorAll('input.nw-slider')) paintSlider(slider) document.addEventListener('input', (event) => { if (event.target instanceof HTMLInputElement && event.target.matches('.nw-slider')) paintSlider(event.target) })
// Tab lists: click and arrow keys move selection (roving tabindex), Home and End jump. for (const tabs of document.querySelectorAll('[data-tabs]')) { const list = tabs.querySelector('[role="tablist"]') if (!list) continue const vertical = list.getAttribute('aria-orientation') === 'vertical' const enabledTabs = () => [...list.querySelectorAll('[role="tab"]:not(:disabled)')]
const select = (tab, focus) => { for (const item of list.querySelectorAll('[role="tab"]')) { const selected = item === tab item.setAttribute('aria-selected', String(selected)) item.tabIndex = selected ? 0 : -1 const panel = document.getElementById(item.getAttribute('aria-controls')) if (panel) panel.hidden = !selected } if (focus) tab.focus() }
list.addEventListener('click', (event) => { const tab = event.target instanceof Element ? event.target.closest('[role="tab"]') : null if (tab && !tab.disabled) select(tab, false) })
list.addEventListener('keydown', (event) => { const all = enabledTabs() const index = all.indexOf(document.activeElement) if (index < 0) return const previousKey = vertical ? 'ArrowUp' : 'ArrowLeft' const nextKey = vertical ? 'ArrowDown' : 'ArrowRight' let next if (event.key === nextKey) next = all[(index + 1) % all.length] else if (event.key === previousKey) next = all[(index - 1 + all.length) % all.length] else if (event.key === 'Home') next = all[0] else if (event.key === 'End') next = all[all.length - 1] if (!next) return event.preventDefault() select(next, true) }) }
// The indeterminate state of a checkbox has no attribute; it is a DOM property. for (const box of document.querySelectorAll('[data-indeterminate]')) box.indeterminate = true}.nw-breadcrumbs
Section titled “.nw-breadcrumbs”Breadcrumbs are a <nav aria-label="Breadcrumb"> around an ordered list. The separator is drawn by CSS between items, a slash in the mono face by default, so the markup stays a plain list. The current page is the item with aria-current="page"; it is styled as the end of the trail and need not be a link.
<div class="nw-stack"> <nav class="nw-breadcrumbs" aria-label="Breadcrumb"> <ol> <li><a href="#nw-breadcrumbs">Home</a></li> <li><a href="#nw-breadcrumbs">Docs</a></li> <li><a href="#nw-breadcrumbs">Components</a></li> <li aria-current="page">Breadcrumbs</li> </ol> </nav> <nav class="nw-breadcrumbs nw-breadcrumbs-chevron" aria-label="Breadcrumb with chevrons"> <ol> <li><a href="#nw-breadcrumbs">Home</a></li> <li><span class="nw-breadcrumbs-ellipsis" aria-label="More">...</span></li> <li><a href="#nw-breadcrumbs">Overlays</a></li> <li aria-current="page">Chevron separators</li> </ol> </nav> <nav class="nw-breadcrumbs nw-breadcrumbs-dot nw-breadcrumbs-sm" aria-label="Breadcrumb with dots, small"> <ol> <li><a href="#nw-breadcrumbs">Home</a></li> <li><a href="#nw-breadcrumbs">Dot separators</a></li> <li aria-current="page">Small</li> </ol> </nav> <nav class="nw-breadcrumbs nw-breadcrumbs-lg" aria-label="Breadcrumb with custom separators, large"> <ol> <li><a href="#nw-breadcrumbs">Home</a></li> <li class="nw-breadcrumbs-separator" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg></li> <li><a href="#nw-breadcrumbs">Custom separator</a></li> <li class="nw-breadcrumbs-separator" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg></li> <li aria-current="page">Large</li> </ol> </nav> <nav class="nw-breadcrumbs nw-breadcrumbs-eyebrow nw-breadcrumbs-secondary" aria-label="Breadcrumb as eyebrow"> <ol> <li><a href="#nw-breadcrumbs">Grid</a></li> <li><a href="#nw-breadcrumbs">Sector 7</a></li> <li aria-current="page">Uplink</li> </ol> </nav></div>| Class / selector | Effect |
|---|---|
nw-breadcrumbs |
The nav wrapper; slash separators. |
nw-breadcrumbs-chevron |
Chevron separators, painted through a mask. |
nw-breadcrumbs-arrow |
Arrow separators. |
nw-breadcrumbs-dot |
Dot separators. |
nw-breadcrumbs-separator |
An <li> that renders its own separator; the automatic one is turned off. Mark it aria-hidden="true". |
nw-breadcrumbs-icon |
Icon slot inside a link; mark it aria-hidden. |
nw-breadcrumbs-ellipsis |
Truncation marker for collapsed levels; give it an aria-label. |
nw-breadcrumbs-eyebrow |
Uppercase mono, for use as a page-header eyebrow. |
nw-breadcrumbs-xs … -lg |
Type sizes. |
nw-breadcrumbs-primary … -danger |
The current crumb’s ink. |
[aria-current="page"] |
The current item, also when it is the link inside it. |
:focus-visible |
Focus ring on links. |
.nw-pagination
Section titled “.nw-pagination”Pagination is a <nav aria-label="Pagination"> around a list. Items are links for server-rendered pages or buttons for client state. The current page carries aria-current="page" (or data-selected); numerals are mono and tabular so the items keep one width.
<div class="nw-stack"> <nav class="nw-pagination nw-pagination-between" aria-label="Relays"> <span class="nw-pagination-summary">21-40 of 212</span> <ul class="nw-pagination-list"> <li><a class="nw-pagination-item nw-pagination-prev" href="#nw-pagination">Prev</a></li> <li><a class="nw-pagination-item" href="#nw-pagination">1</a></li> <li><a class="nw-pagination-item" href="#nw-pagination" aria-current="page">2</a></li> <li><a class="nw-pagination-item" href="#nw-pagination">3</a></li> <li><span class="nw-pagination-ellipsis" aria-hidden="true">...</span></li> <li><a class="nw-pagination-item" href="#nw-pagination">11</a></li> <li><a class="nw-pagination-item nw-pagination-next" href="#nw-pagination">Next</a></li> </ul> </nav> <nav class="nw-pagination nw-pagination-outline nw-pagination-sm" aria-label="Outline pages"> <ul class="nw-pagination-list"> <li><button type="button" class="nw-pagination-item" aria-label="Previous page" disabled>‹</button></li> <li><button type="button" class="nw-pagination-item" aria-current="page">1</button></li> <li><button type="button" class="nw-pagination-item">2</button></li> <li><button type="button" class="nw-pagination-item">3</button></li> <li><button type="button" class="nw-pagination-item" aria-label="Next page">›</button></li> </ul> </nav> <nav class="nw-pagination nw-pagination-pill nw-pagination-solid nw-pagination-lg nw-pagination-secondary" aria-label="Pill pages"> <ul class="nw-pagination-list"> <li><button type="button" class="nw-pagination-item nw-pagination-prev">Prev</button></li> <li><button type="button" class="nw-pagination-item">4</button></li> <li><button type="button" class="nw-pagination-item" data-selected>5</button></li> <li><button type="button" class="nw-pagination-item">6</button></li> <li><button type="button" class="nw-pagination-item nw-pagination-next" aria-disabled="true">Next</button></li> </ul> </nav> <nav class="nw-pagination nw-pagination-cut nw-pagination-end" aria-label="Cut pages"> <ul class="nw-pagination-list"> <li><button type="button" class="nw-pagination-item">8</button></li> <li><button type="button" class="nw-pagination-item" aria-current="page">9</button></li> </ul> </nav></div>| Class / selector | Effect |
|---|---|
nw-pagination |
The nav wrapper, a row. |
nw-pagination-list |
The list; a bare <ul> inside works too. |
nw-pagination-item |
A page, previous or next control (<a> or <button>). |
nw-pagination-prev, -next |
Edge controls; icon-only ones need an aria-label. |
nw-pagination-ellipsis |
Gap marker between page numbers. |
nw-pagination-summary |
A caption such as “21-40 of 212”. |
nw-pagination-solid |
The current item is filled and glows. |
nw-pagination-outline |
Every item is a bordered control. |
nw-pagination-pill |
Fully rounded items. |
nw-pagination-cut |
Chamfered items; the current one glows through a filter. |
nw-pagination-xs … -lg |
Item sizes. |
nw-pagination-center, -end, -between |
Aligns the list, or spreads the summary and the list. |
nw-pagination-primary … -danger |
The intent of the current item. |
[aria-current="page"], [data-selected], nw-pagination-active |
The current page. |
:disabled, [aria-disabled="true"] |
Disabled item. |
.nw-link
Section titled “.nw-link”nw-link styles an inline link: primary ink, an underline that brightens on hover.
A primary link, a secondary link, a subtle link, a quiet link, an external link, an inherited-ink link, a link with an icon and a disabled link.
<p> A <a class="nw-link" href="#nw-link">primary link</a>, a <a class="nw-link nw-link-secondary" href="#nw-link">secondary link</a>, a <a class="nw-link nw-link-subtle" href="#nw-link">subtle link</a>, a <a class="nw-link nw-link-quiet" href="#nw-link">quiet link</a>, an <a class="nw-link nw-link-external" href="#nw-link">external link</a>, an <a class="nw-link nw-link-inherit" href="#nw-link">inherited-ink link</a>, a <a class="nw-link" href="#nw-link"><svg class="nw-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 14L21 3M15 3h6v6M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"/></svg>link with an icon</a> and a <a class="nw-link" href="#nw-link" aria-disabled="true">disabled link</a>.</p>| Class | Effect |
|---|---|
nw-link |
Primary ink with a brightening underline. |
nw-link-primary … -danger |
Intent inks. |
nw-link-subtle |
Muted until hovered. |
nw-link-quiet |
Colored, underlined on hover only. |
nw-link-inherit |
The surrounding ink, for links inside headings and labels. |
nw-link-external |
Appends an arrow glyph; put your own <svg class="nw-link-icon"> inside for a custom icon. |
nw-link-glow |
The text blooms in its ink on hover and focus. |
nw-link-xs, -sm, -md, -lg |
Type sizes, for a link that stands alone; an inline link inherits its paragraph. |
nw-link-disabled, [aria-disabled="true"] |
Dimmed, no pointer events. Also remove href or handle the click so keyboard users cannot follow it. |
Navigation links
Section titled “Navigation links”nw-link-nav turns a link into a navigation item: no underline, current page in the intent ink. [aria-current] (page or true) and nw-link-active mark it.
<nav class="nw-cluster" aria-label="Sections"> <a class="nw-link nw-link-nav" href="#navigation-links" aria-current="page">Overview</a> <a class="nw-link nw-link-nav" href="#navigation-links">Relays</a> <a class="nw-link nw-link-nav nw-link-active" href="#navigation-links">Active class</a> <a class="nw-link nw-link-nav" href="#navigation-links">Settings</a></nav>.nw-navbar
Section titled “.nw-navbar”The navbar is the top bar of an app shell: a brand, a link row and actions, with a toggle that opens the region under 48rem. The toggle needs one line of script to flip aria-expanded on itself and data-state="open" on the region; the demo uses the data-toggle behavior from the script below.
<header class="nw-navbar"> <div class="nw-navbar-inner"> <a class="nw-navbar-brand" href="#nw-navbar">NIGHT<span class="nw-navbar-brand-mark">WIRE</span></a> <button type="button" class="nw-navbar-toggle" aria-expanded="false" aria-controls="nav-demo" data-toggle="#nav-demo">Menu</button> <div class="nw-navbar-collapse" id="nav-demo"> <nav class="nw-navbar-nav" aria-label="Primary"> <a class="nw-navbar-link" href="#nw-navbar" aria-current="page">Overview</a> <a class="nw-navbar-link" href="#nw-navbar">Relays</a> <a class="nw-navbar-link" href="#nw-navbar" aria-disabled="true">Beta</a> </nav> <div class="nw-navbar-actions"> <span class="nw-navbar-spacer"></span> <button type="button" class="nw-btn nw-btn-sm nw-btn-ghost nw-btn-neutral">Docs</button> <button type="button" class="nw-btn nw-btn-sm">Open console</button> </div> </div> </div></header><div class="nw-stack nw-stack-sm"> <header class="nw-navbar nw-navbar-glass"> <div class="nw-navbar-inner"> <a class="nw-navbar-brand" href="#nw-navbar">Glass</a> <nav class="nw-navbar-nav" aria-label="Glass nav"><a class="nw-navbar-link" href="#nw-navbar" aria-current="page">One</a><a class="nw-navbar-link" href="#nw-navbar">Two</a></nav> </div> </header> <header class="nw-navbar nw-navbar-wire"> <div class="nw-navbar-inner"> <a class="nw-navbar-brand" href="#nw-navbar">Wire</a> <nav class="nw-navbar-nav" aria-label="Wire nav"><a class="nw-navbar-link" href="#nw-navbar" aria-current="page">One</a><a class="nw-navbar-link" href="#nw-navbar">Two</a></nav> </div> </header> <header class="nw-navbar nw-navbar-solid nw-navbar-danger"> <div class="nw-navbar-inner"> <a class="nw-navbar-brand" href="#nw-navbar">Solid, danger</a> <nav class="nw-navbar-nav" aria-label="Solid nav"><a class="nw-navbar-link" href="#nw-navbar" aria-current="page">Alarm</a></nav> </div> </header></div>| Class / selector | Effect |
|---|---|
nw-navbar |
The bar: hairline bottom edge, glass fill by default. |
nw-navbar-inner |
A row for the brand and the region; add nw-container to bound its width. |
nw-navbar-brand |
The wordmark; nw-navbar-brand-mark sets the accent half (NIGHTWIRE). |
nw-navbar-nav |
The link row. |
nw-navbar-link |
A bar link; [aria-current] and nw-navbar-link-active mark the current page. |
nw-navbar-actions, nw-navbar-spacer |
The action row, and the spacer that pushes it to the end. |
nw-navbar-toggle |
The narrow-screen trigger. Its glyph swaps when aria-expanded="true". |
nw-navbar-collapse |
The region the toggle opens under 48rem, through data-state="open". |
nw-navbar-sticky |
position: sticky at the top. |
nw-navbar-solid, -glass, -wire, -floating |
Sunken fill; translucent glass (default); the gradient wire as the bottom edge; a detached, rounded bar. |
nw-navbar-sm, -md, -lg |
Bar height. |
nw-navbar-primary … -danger |
The current link’s ink and the wire’s colors. |
Name the collapsed region with aria-controls on the toggle, and keep it in the DOM but data-state="closed" rather than removing it, so it stays in the accessibility tree.
.nw-sidenav
Section titled “.nw-sidenav”The sidenav is the vertical navigation of an app shell: sections with labels, links with icons and counts, collapsible groups, a header and a footer.
<nav class="nw-sidenav" aria-label="Sections"> <div class="nw-sidenav-header"> <a class="nw-navbar-brand" href="#nw-sidenav">NIGHT<span class="nw-navbar-brand-mark">WIRE</span></a> </div> <div class="nw-sidenav-section"> <span class="nw-sidenav-label">Monitor</span> <ul class="nw-sidenav-list"> <li><a class="nw-sidenav-link" href="#nw-sidenav" aria-current="page"><span class="nw-sidenav-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 12h4l3-8 4 16 3-8h4"/></svg></span><span class="nw-sidenav-text">Overview</span></a></li> <li><a class="nw-sidenav-link" href="#nw-sidenav"><span class="nw-sidenav-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg></span><span class="nw-sidenav-text">Relays</span><span class="nw-sidenav-badge nw-badge-sm">12</span></a></li> <li> <a class="nw-sidenav-link" href="#nw-sidenav" aria-expanded="false" data-toggle="#sidenav-sub-demo"><span class="nw-sidenav-text">Regions</span></a> <ul class="nw-sidenav-sub" id="sidenav-sub-demo" data-state="closed"> <li><a class="nw-sidenav-link" href="#nw-sidenav"><span class="nw-sidenav-text">eu-north</span></a></li> <li><a class="nw-sidenav-link" href="#nw-sidenav"><span class="nw-sidenav-text">us-east</span></a></li> </ul> </li> </ul> </div> <div class="nw-sidenav-footer">v2.4.0</div></nav>| Class / selector | Effect |
|---|---|
nw-sidenav |
The panel: a stack with a hairline when bordered or solid. |
nw-sidenav-header, -footer |
The top and bottom rows. |
nw-sidenav-section, nw-sidenav-label |
A titled group of links. |
nw-sidenav-list |
A list of links; its margins collapse. |
nw-sidenav-link |
A link row: icon, text and badge. |
nw-sidenav-icon, -text, -badge |
The slots; the badge is a nw-badge. |
nw-sidenav-sub |
The indented sub list behind a hairline, shown unless hidden or data-state="closed". |
[aria-expanded] on a link |
A collapsible group trigger; the chevron turns on aria-expanded="true". |
nw-sidenav-solid |
The current link is a filled, glowing block. |
nw-sidenav-collapsed |
An icon rail: the text and badges stay in the accessibility tree. |
nw-sidenav-flush, -sticky, -end |
No padding; sticks to the viewport; flips to the inline-end side. |
nw-sidenav-xs … -lg |
Row sizes. |
nw-sidenav-primary … -danger |
The current link’s ink. |
[aria-current="page"], nw-sidenav-link-active |
The current link. |
.nw-steps
Section titled “.nw-steps”Steps show where a user is in a sequence. Markers number themselves with a CSS counter; a completed marker swaps the number for a check, and the connector between markers fills as steps complete.
-
ConnectLink a node to the grid.
-
Check routeThe marker numbers itself; the current one glows.
-
Go live
- Connected
- Route check failedError state.
- Go live
- Done
- Dots
- Next
<ol class="nw-steps"> <li class="nw-step" data-state="complete"> <span class="nw-step-marker" aria-hidden="true"></span> <div class="nw-step-body"><span class="nw-step-title">Connect</span><span class="nw-step-description">Link a node to the grid.</span></div> </li> <li class="nw-step" aria-current="step"> <span class="nw-step-marker" aria-hidden="true"></span> <div class="nw-step-body"><span class="nw-step-title">Check route</span><span class="nw-step-description">The marker numbers itself; the current one glows.</span></div> </li> <li class="nw-step" data-state="upcoming"> <span class="nw-step-marker" aria-hidden="true"></span> <div class="nw-step-body"><span class="nw-step-title">Go live</span></div> </li></ol><ol class="nw-steps nw-steps-vertical nw-steps-sm nw-steps-secondary"> <li class="nw-step" data-state="complete"><span class="nw-step-marker" aria-hidden="true"></span><div class="nw-step-body"><span class="nw-step-title">Connected</span></div></li> <li class="nw-step" data-state="error"><span class="nw-step-marker" aria-hidden="true"></span><div class="nw-step-body"><span class="nw-step-title">Route check failed</span><span class="nw-step-description">Error state.</span></div></li> <li class="nw-step"><span class="nw-step-marker" aria-hidden="true"></span><div class="nw-step-body"><span class="nw-step-title">Go live</span></div></li></ol><ol class="nw-steps nw-steps-dots nw-steps-lg nw-steps-success"> <li class="nw-step" data-state="complete"><span class="nw-step-marker" aria-hidden="true"></span><div class="nw-step-body"><span class="nw-step-title">Done</span></div></li> <li class="nw-step" aria-current="step"><span class="nw-step-marker" aria-hidden="true"></span><div class="nw-step-body"><span class="nw-step-title">Dots</span></div></li> <li class="nw-step"><span class="nw-step-marker" aria-hidden="true"></span><div class="nw-step-body"><span class="nw-step-title">Next</span></div></li></ol>| Class / selector | Effect |
|---|---|
nw-steps |
The row of steps. |
nw-step |
One step: a marker and its body. |
nw-step-marker |
The numbered marker; render it as a <button> or <a> to make it clickable. |
nw-step-body, -title, -description |
The text beside the marker. |
data-state="complete", nw-step-complete |
Completed: check marker, filled connector. |
aria-current="step", data-state="current", nw-step-current |
The current step: glowing marker, intent title. |
data-state="error" |
A failed step in the danger intent. |
nw-steps-vertical |
The flow runs downward. |
nw-steps-dots |
Shrinks the markers to dots. |
nw-steps-cut |
Chamfered markers. |
nw-steps-sm, -md, -lg |
Marker and title sizes. |
nw-steps-primary … -danger |
Ink of completed and current steps. |
A marker is decorative: the step’s state must also be readable as text, for example through the title, or it is lost to assistive technology and forced colors.