Layout
The shell you are looking at. Most of this page cannot be demonstrated in a box, because the components are the page — so the markup is here in full, and the live example is the window around it.
The shell
A grid with two tracks and one scroll container. The page itself never scrolls — only
.av-content does, which is what keeps the sidebar and topbar fixed
without a single position: fixed and without the scroll-jank that comes
with one.
<div class="av-shell">
<aside class="av-sidebar" id="avSidebar">…</aside>
<div class="av-main">
<header class="av-topbar">…</header>
<main class="av-content" id="avContent">
…your page…
<footer class="av-footer">…</footer>
</main>
</div>
</div>
<div class="av-sidebar-backdrop" data-av-sidebar-backdrop></div>
min-inline-size: 0 is not optional on a grid child
A grid or flex item's automatic minimum size is its content's min-content width. A
1fr track holding a wide table therefore grows past the viewport
instead of letting the table scroll inside its own wrapper — and because
.av-content absorbs the excess, a document-level overflow check still
passes while the page is visibly broken.
.av-main, .av-sidebar and .av-grid > * all
set it for exactly this reason.
Sidebar
Three states from one element: expanded, collapsed to icons, and an off-canvas drawer below 992px with a backdrop. The toggle is one button and one attribute; there is no second mobile sidebar in the markup.
<button class="av-btn av-btn--outline" type="button" data-av-sidebar-toggle
aria-expanded="true" aria-controls="avSidebar">
<svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg>
Collapse the sidebar
</button>
Menu markup
<nav class="av-sidebar__nav" aria-label="Main">
<ul class="av-menu">
<li class="av-menu__title" aria-hidden="true">Overview</li>
<li class="av-menu__item av-menu__item--active">
<a class="av-menu__link" href="/analytics" aria-current="page">
<svg class="av-icon av-menu__icon" aria-hidden="true">…</svg>
<span class="av-menu__label">Analytics</span>
<span class="av-menu__badge">4</span>
</a>
</li>
<li class="av-menu__item av-menu__item--has-children">
<button class="av-menu__link" type="button" aria-expanded="false" aria-controls="menuCatalog">
<span class="av-menu__label">Catalog</span>
<svg class="av-icon av-menu__caret" aria-hidden="true">…</svg>
</button>
<ul class="av-menu__sub" id="menuCatalog">…</ul>
</li>
</ul>
</nav>
The section title is aria-hidden: it is a visual grouping, and a screen
reader reading "Overview" as a list item before every row adds nothing.
aria-current="page" is what marks the active row for assistive
technology — the --active class only paints it.
The rail is themable on its own
Fourteen tokens, each defaulting to the page semantic it replaces
An ink rail beside a light canvas reads as a different product, which is why the sidebar carries its own slice of the token system rather than inheriting the page's. A preset that says nothing about the sidebar is unchanged.
Three of those exist only because of the ink case, and each marks a real failure.
--av-sidebar-title is separate because the 10px section captions
measured about 3.5:1 in every preset;
--av-sidebar-marker defaults to the accent because a theme whose primary
is ink paints an invisible marker on an ink rail; and
--av-sidebar-cta-* is separate from the primary because the upgrade
button is the one place ink lands on ink.
Topbar
The search trigger, mode toggle, notification bell and profile menu. Every one of them is a component documented elsewhere; the topbar is only the row they sit in.
<header class="av-topbar">
<div class="av-topbar__start">
<button class="av-btn av-btn--ghost av-btn--icon av-topbar__menu-btn"
type="button" data-av-sidebar-toggle aria-label="Open the menu">…</button>
<button class="av-search-trigger" type="button" data-av-palette-open>
<span class="av-search-trigger__text">Search…</span>
<kbd class="av-kbd">Ctrl</kbd><kbd class="av-kbd">K</kbd>
</button>
</div>
<div class="av-topbar__end">
<button class="av-btn av-btn--ghost av-btn--icon" type="button" data-av-theme-toggle>…</button>
<div class="av-dropdown">…the bell…</div>
<div class="av-dropdown">…the profile…</div>
</div>
</header>
- Healthy
- CPU 0.42
- RAM 63%
- Disk 93%
- Online 12
<div class="av-vitals" role="group" aria-label="Example system status">
<ul class="av-vitals__list">
<li class="av-vitals__entry">
<span class="av-vitals__item">
<span class="av-dot av-dot--success" aria-hidden="true"></span>
<span class="av-vitals__value">Healthy</span>
</span>
</li>
<li class="av-vitals__entry av-vitals__entry--secondary">
<span class="av-vitals__item">CPU <span class="av-vitals__value">0.42</span></span>
</li>
<li class="av-vitals__entry av-vitals__entry--tertiary">
<span class="av-vitals__item">
RAM <span class="av-vitals__value">63%</span>
<span class="av-vitals__meter" style="--av-vitals-value: 63" aria-hidden="true"></span>
</span>
</li>
<li class="av-vitals__entry">
<span class="av-vitals__item av-vitals__item--danger">
Disk <span class="av-vitals__value">93%</span>
<span class="av-vitals__meter" style="--av-vitals-value: 93" aria-hidden="true"></span>
</span>
</li>
<li class="av-vitals__entry">
<span class="av-vitals__item">Online <span class="av-vitals__value">12</span></span>
</li>
</ul>
<button class="av-vitals__summary" type="button" data-av-drawer-open="#avVitalsDrawer"
aria-haspopup="dialog" aria-label="System status: one problem. Show details">
<span class="av-dot av-dot--danger" aria-hidden="true"></span>
<span aria-hidden="true">Status</span>
</button>
</div>
<div class="av-player" role="region" aria-label="Player">
<div class="av-player__inner">
<div class="av-player__media">
<span class="av-thumb" aria-hidden="true"><svg class="av-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M9 18V5l11-2v13"/><circle cx="6.5" cy="18" r="2.5"/><circle cx="17.5" cy="16" r="2.5"/></svg></span>
<div class="av-player__text">
<span class="av-player__title">Night Drive</span>
<span class="av-player__subtitle">Nova Kade</span>
</div>
</div>
<div class="av-player__centre">
<div class="av-player__transport">
<button class="av-btn av-btn--ghost av-btn--icon av-btn--sm av-player__control av-player__control--secondary" type="button" aria-label="Shuffle" aria-pressed="false"><svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M3 7h3.5c2 0 3.2 1 4.3 2.7l2.4 4.6c1.1 1.7 2.3 2.7 4.3 2.7H21M18 14l3 3-3 3M3 17h3.5c1.4 0 2.4-.5 3.2-1.4M14.3 8.4c.8-.9 1.8-1.4 3.2-1.4H21M18 4l3 3-3 3"/></svg></button>
<button class="av-btn av-btn--ghost av-btn--icon av-btn--sm av-player__control av-player__control--step" type="button" aria-label="Previous"><svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M18 6v12l-9-6zM6 6v12"/></svg></button>
<button class="av-btn av-btn--primary av-btn--icon" type="button" aria-label="Pause"><svg class="av-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M8 5v14M16 5v14"/></svg></button>
<button class="av-btn av-btn--ghost av-btn--icon av-btn--sm av-player__control av-player__control--step" type="button" aria-label="Next"><svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6v12l9-6zM18 6v12"/></svg></button>
<button class="av-btn av-btn--ghost av-btn--icon av-btn--sm av-player__control av-player__control--secondary" type="button" aria-label="Repeat" aria-pressed="true"><svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M4 11V9a3 3 0 0 1 3-3h13M17 3l3 3-3 3M20 13v2a3 3 0 0 1-3 3H4M7 21l-3-3 3-3"/></svg></button>
</div>
<div class="av-player__seek">
<span class="av-player__time">1:24</span>
<input class="av-range" type="range" name="player-seek" min="0" max="312" value="84" aria-label="Seek" aria-valuetext="1 minute 24 seconds of 5 minutes 12 seconds" style="--av-range-fill: 27%">
<span class="av-player__time">5:12</span>
</div>
</div>
<div class="av-player__aside">
<button class="av-btn av-btn--ghost av-btn--icon av-btn--sm av-player__control" type="button" aria-label="Mute"><svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M4 9.5v5h4l5 4v-13l-5 4zM16.5 9a4 4 0 0 1 0 6M19 6.5a7.5 7.5 0 0 1 0 11"/></svg></button>
<input class="av-range av-player__volume" type="range" name="player-volume" min="0" max="100" value="80" aria-label="Volume" style="--av-range-fill: 80%">
<button class="av-btn av-btn--ghost av-btn--icon av-btn--sm av-player__control" type="button" aria-label="Minimise player"><svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M4 9h5V4M20 9h-5V4M4 15h5v5M20 15h-5v5"/></svg></button>
<button class="av-btn av-btn--ghost av-btn--icon av-btn--sm av-player__control" type="button" aria-label="Close player"><svg class="av-icon av-icon--sm" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6L6 18"/></svg></button>
</div>
</div>
</div>
Page header
Breadcrumb, the page's single <h1>, an optional subtitle, and the
actions that apply to the whole page. Actions wrap under the title on a narrow screen
rather than squeezing it.
Orders
Everything placed in the last 90 days.
<div class="av-page-header" style="border-block-end: 1px solid var(--av-border-subtle); padding-block-end: var(--av-space-4)">
<div>
<ol class="av-breadcrumb" aria-label="Breadcrumb">
<li><a href="#header">Home</a></li>
<li><a href="#header">Commerce</a></li>
<li aria-current="page">Orders</li>
</ol>
<p class="av-page-header__title">Orders</p>
<p class="av-page-header__subtitle">Everything placed in the last 90 days.</p>
</div>
<div class="av-page-header__actions">
<button class="av-btn av-btn--outline" type="button">Export</button>
<button class="av-btn av-btn--primary" type="button">New order</button>
</div>
</div>
Grid
Four helpers, and they cover nearly every dashboard. There is no twelve-column system here on purpose: a column count is a decision about a breakpoint, and these express the intent instead.
<div class="av-grid av-grid--stats">
<div class="av-card"><div class="av-card__body">220px minimum</div></div>
<div class="av-card"><div class="av-card__body">Wraps on its own</div></div>
<div class="av-card"><div class="av-card__body">No column count</div></div>
<div class="av-card"><div class="av-card__body">Nothing to update</div></div>
</div>
<div class="av-grid av-grid--main">
<div class="av-card"><div class="av-card__body">Main — 2fr</div></div>
<div class="av-card"><div class="av-card__body">Side — 1fr</div></div>
</div>
<div class="av-stack-4">
<div class="av-card"><div class="av-card__body">First</div></div>
<div class="av-card"><div class="av-card__body">Second</div></div>
<div class="av-card"><div class="av-card__body">Third</div></div>
</div>
Split panes
The two- and three-pane shell behind mail, chat, files, contacts, notes and the calendar. Only the panes scroll, and pane switching happens only below 768px — above it there is one screen, so a click has nothing to switch to and nothing to push onto history.
<div class="av-split av-split--inspector" data-av-split>
<div class="av-split__list">
<div class="av-split__list-header">…</div>
<ul>
<li><button data-av-split-item>…</button></li>
</ul>
</div>
<div class="av-split__detail">
<button class="av-split__back" type="button" data-av-split-back>Back</button>
…
</div>
</div>
--inspector is the browse-first proportion — flexible middle, fixed
detail — used by files and the calendar. It is a modifier rather than a variable
because mail wants the opposite, and two named intentions read better than one
number set twice.
Layout axes
Attributes on <html>, set by the theme engine and read by CSS. No
JavaScript runs in the render path — the attribute selects a different set of custom
property values and the layout follows. Every button below is live.
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="density:compact">Compact</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="density:comfortable">Comfortable</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="density:spacious">Spacious</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="width:boxed">Boxed</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="radius:sharp">Sharp</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="radius:subtle">Subtle</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="radius:rounded">Rounded</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="radius:pill">Pill</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="motion:reduced">Reduced</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="motion:off">Off</button>
<button class="av-btn av-btn--sm av-btn--outline" type="button" data-av-theme-set="contrast:high">High contrast</button>
<button class="av-btn av-btn--sm av-btn--soft-primary" type="button" data-av-customizer-open>
Open the customiser
</button>
| Attribute | Values |
|---|---|
data-bs-theme | light, dark |
data-av-preset | any of the 16 preset names |
data-av-density | compact, comfortable, spacious |
data-av-width | boxed — absent is fluid |
data-av-radius | sharp, subtle, rounded, pill |
data-av-motion | reduced, off |
data-av-contrast | high |
data-av-sidebar | collapsed, hidden |
Never defer the boot script
A small synchronous script in <head> reads the stored preferences
and writes these attributes before first paint. Deferring it, or moving it
to a bundle, gives every dark-mode visitor a white flash on every navigation — and
no amount of CSS can fix it, because the paint has already happened.
Surfaces
Three ways to group content, distinguished by how much of the page's depth they claim.
Delivery address
14 Fitzwilliam Square, Dublin 2, Ireland
<div class="av-card">
<div class="av-card__body">
<div class="av-panel">
<h3 class="av-panel__title">Delivery address</h3>
<p>14 Fitzwilliam Square, Dublin 2, Ireland</p>
</div>
</div>
</div>
Autumn collection
32 products, live from 1 September
<div class="av-card av-card--media" style="max-inline-size: 18rem">
<div class="av-card__media" role="img" aria-label="Abstract brand gradient"
style="background-image: var(--av-gradient-brand)"></div>
<div class="av-card__body">
<h3 class="av-card__title">Autumn collection</h3>
<p class="av-card__subtitle">32 products, live from 1 September</p>
</div>
</div>
Starter
€9/month
- Up to 3 projects
- 1 GB storage
- Email support
Team
€49/month
- Unlimited projects
- 100 GB storage
- Priority support
- Audit log
<div class="av-pricing-card" style="max-inline-size: 15rem">
<p class="av-pricing-card__name">Starter</p>
<p class="av-pricing-card__price">€9<span class="av-pricing-card__period">/month</span></p>
<ul class="av-pricing-card__features">
<li>Up to 3 projects</li>
<li>1 GB storage</li>
<li>Email support</li>
</ul>
<button class="av-btn av-btn--ghost av-pricing-card__cta" type="button">Choose Starter</button>
</div>
<div class="av-pricing-card av-pricing-card--featured" style="max-inline-size: 15rem">
<p class="av-pricing-card__name">Team</p>
<p class="av-pricing-card__price">€49<span class="av-pricing-card__period">/month</span></p>
<ul class="av-pricing-card__features">
<li>Unlimited projects</li>
<li>100 GB storage</li>
<li>Priority support</li>
<li>Audit log</li>
</ul>
<button class="av-btn av-btn--primary av-pricing-card__cta" type="button">Choose Team</button>
</div>