Skip to content

App shell

BetaLayoutOpen in the workshop

Sidebar, topbar and the content area: the frame every admin screen sits in.

.xg-shell > nav.xg-sidebar + .xg-shell__main > header.xg-topbar + main.xg-shell__content (.xg-page-head first)

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.

App shell

Dashboard

/
OT

Good morning

Here is how November is going.

Revenue $150.2K +12.4%vs Oct
Fill rate 92.4% +3.1 ptsvs Oct
Markup
<div class="xg-shell" style="min-height:420px;border-radius:var(--xg-radius-card);border:1px solid var(--xg-color-border-default)">
<nav class="xg-sidebar" id="nav-shell" 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-shell" 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 class="xg-shell__main">
<header class="xg-topbar">
<h2 class="xg-topbar__title">Dashboard</h2>
<span class="xg-spacer">
</span>
<div class="xg-input-group">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<circle cx="11" cy="11" r="7"/>
<path d="m20 20-3.5-3.5"/>
</svg>
<input class="xg-input xg-input--sm" type="search" placeholder="Search" aria-label="Search everything">
<span class="xg-input-group__affix">
<kbd class="xg-kbd">/</kbd>
</span>
</div>
<button class="xg-btn xg-btn--ghost xg-btn--icon xg-notify" type="button" aria-label="Notifications, 2 unread">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M6 8a6 6 0 1 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/>
<path d="M10.3 21a1.9 1.9 0 0 0 3.4 0"/>
</svg>
</button>
<span class="xg-avatar" aria-label="Account: Ops team" role="img">OT</span>
</header>
<main class="xg-shell__content">
<div class="xg-page-head">
<div>
<h1 class="xg-h2">Good morning</h1>
<p>Here is how November is going.</p>
</div>
<button class="xg-btn" type="button">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M12 5v14"/>
<path d="M5 12h14"/>
</svg>New campaign</button>
</div>
<div class="xg-kpi-grid">
<div class="xg-card xg-kpi">
<span class="xg-kpi__label">Revenue</span>
<span class="xg-kpi__value">$150.2K</span>
<span class="xg-kpi__meta">
<span class="xg-delta xg-delta--up">+12.4%</span>vs Oct</span>
</div>
<div class="xg-card xg-kpi">
<span class="xg-kpi__label">Fill rate</span>
<span class="xg-kpi__value">92.4%</span>
<span class="xg-kpi__meta">
<span class="xg-delta xg-delta--up">+3.1 pts</span>vs Oct</span>
</div>
</div>
</main>
</div>
</div>

When to use it

Use it for

every authenticated screen.

Not for

sign-up and login (centered single card).

Rules

  • Content max width none for tables; 1240 px for forms and settings.
  • The page head carries the title, one line of context, the date range and the page’s primary action.
  • The background is the page color with two soft brand blurs; content sits on solid cards.

Accessibility

  • Landmarks: <nav>, <header>, <main>. A skip link to main is the first focusable element.

Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.

Also in Layout: Card and glass panel. Used in the patterns Dashboard.

Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).