The top bar, the left menu and the phone tab bar every app shares.
<div class="cap-shell" data-cap="shell" data-cap-pref="cap-rail-specimen-expanded">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main">
<svg width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path fill="var(--accent)" d="M10 1 17.8 5.5v9L10 19l-7.8-4.5v-9z" /><path fill="var(--surface)" d="M10 5.4 14 7.7v4.6L10 14.6 6 12.3V7.7z" /></svg>
Capsid Portal <small>sample</small>
</a>
<div class="cap-shell-spacer"></div>
<span class="cap-muted" data-hide="phone">Updated 40 seconds ago</span>
<div class="cap-shell-actions">
<button type="button" class="cap-btn" data-hide="phone">Commands <kbd>Ctrl K</kbd></button>
<fieldset class="cap-theme" data-cap="theme-switch" data-cap-pref="cap-theme-specimen-expanded">
<legend class="cap-sr-only">Theme</legend>
<div class="cap-theme-options">
<label><input type="radio" name="theme-expanded" value="light" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" /><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1" /></svg><span class="cap-theme-text">Light</span></label>
<label><input type="radio" name="theme-expanded" value="dark" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 9.3A5.5 5.5 0 0 1 6.7 2.5a5.5 5.5 0 1 0 6.8 6.8z" /></svg><span class="cap-theme-text">Dark</span></label>
</div>
</fieldset>
<a class="cap-btn cap-shell-settings" data-icon-only data-hide="phone" href="#cap-main" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M3.4 12.6l1.4-1.4M11.2 4.8l1.4-1.4" /></svg></a>
<button type="button" class="cap-btn">Sign out</button>
</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<div class="cap-shell-group" role="group" aria-labelledby="g-watch">
<div class="cap-shell-group-label" id="g-watch">Watch</div>
<a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg><span class="cap-shell-label">Overview</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main" aria-label="Sites, 2 down or degraded"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-label">Sites</span> <span class="cap-shell-count" data-tone="crit">2</span></a>
<a href="#cap-main" aria-label="Queue, 3 blocked"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg><span class="cap-shell-label">Queue</span> <span class="cap-shell-count" data-tone="warn">3</span></a>
</div>
<div class="cap-shell-group" role="group" aria-labelledby="g-record">
<div class="cap-shell-group-label" id="g-record">Record</div>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M3 2h10v12H3z" opacity=".35" /><path fill="currentColor" d="M5 5h6v1.5H5zM5 8h6v1.5H5z" /></svg><span class="cap-shell-label">Activity</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" d="m3.5 8.5 3 3 6-7" /></svg><span class="cap-shell-label">Reports</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-label">Backups</span> <span class="cap-shell-count"></span></a>
</div>
<div class="cap-shell-foot">
<div class="cap-shell-hint">
<button type="button" class="cap-shell-linkish"><span>Command menu</span><span><kbd>Ctrl</kbd> <kbd>K</kbd></span></button>
<button type="button" class="cap-shell-linkish"><span>Shortcuts</span><kbd>?</kbd></button>
</div>
<button type="button" class="cap-shell-toggle" data-cap-part="rail-toggle" aria-expanded="true" aria-controls="cap-rail"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M2.5 2.5h11v11h-11zM6 2.5v11M10.5 6 8.5 8l2 2" /></svg><span class="cap-shell-label">Collapse menu</span><kbd aria-hidden="true">[</kbd></button>
</div>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Overview</h1>
<p>The page's own content sits here, and the document scrolls. Activity shows hover and Backups shows pressed; keyboard focus is the 2 px ring.</p>
</div>
</main>
<nav class="cap-shell-tabs" aria-label="Sections">
<a href="#cap-main" aria-current="page">Overview</a><a href="#cap-main" aria-label="Sites, 2 down or degraded">Sites <span class="cap-count cap-shell-badge" data-tone="crit">2</span></a><a href="#cap-main">Queue</a><a href="#cap-main">Activity</a>
</nav>
</div>
Copy
View code
Installation
HTML and CSS React
// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/shell.css";
import { enhance } from "capsomer/behavior/shell";
enhance();Copy
import "capsomer/tokens.css";
import "capsomer/shell.css";
import { Shell } from "capsomer/react/shell";Copy
Usage
<div class="cap-shell" data-cap="shell">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="/">[mark] Name</a>
<div class="cap-shell-spacer"></div>
[status]
<div class="cap-shell-actions">[actions] [theme switch]
<a class="cap-btn cap-shell-settings" data-icon-only data-hide="phone" href="/settings" aria-label="Settings">[icon]</a> [Sign out]</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<div class="cap-shell-group" role="group" aria-labelledby="g-watch"> <!-- optional -->
<div class="cap-shell-group-label" id="g-watch">Watch</div>
<a href="/" aria-current="page">[icon]<span class="cap-shell-label">Overview</span> <span class="cap-shell-count"></span></a>
<a href="/queue" aria-label="Queue, 3 blocked">[icon]<span class="cap-shell-label">Queue</span> <span class="cap-shell-count" data-tone="warn">3</span></a>
</div>
<div class="cap-shell-foot">
<div class="cap-shell-hint">
<button type="button" class="cap-shell-linkish"><span>Command menu</span><span><kbd>Ctrl</kbd> <kbd>K</kbd></span></button>
</div>
<button type="button" class="cap-shell-toggle" data-cap-part="rail-toggle" aria-expanded="true" aria-controls="cap-rail">[icon]<span class="cap-shell-label">Collapse menu</span><kbd aria-hidden="true">[</kbd></button>
</div>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1"><div class="cap-shell-page">[the view]</div></main>
<nav class="cap-shell-tabs" aria-label="Sections">
<a href="/" aria-current="page">[icon]Overview</a> [... up to four links]
<button type="button" data-cap-part="more" aria-haspopup="dialog" aria-expanded="false" aria-controls="cap-more">[icon]More</button>
</nav>
<dialog class="cap-dialog cap-shell-more" data-cap="dialog" data-placement="bottom" id="cap-more" aria-labelledby="cap-more-title">
<div class="cap-dialog-header"><h2 class="cap-dialog-title" id="cap-more-title">More views</h2></div>
<div class="cap-dialog-body">
<nav aria-labelledby="cap-more-title"><ul class="cap-shell-more-list">
<li><a href="/namespaces">[icon]<span class="cap-shell-more-name">Namespaces</span> <span class="cap-shell-count">1 paused</span></a></li>
</ul></nav>
</div>
<button type="button" class="cap-btn cap-dialog-close" data-variant="quiet" data-icon-only data-cap-part="close" aria-label="Close">[icon]</button>
</dialog>
</div>Copy
Examples
The site's logo beside the name, in the top bar
<div class="cap-shell" data-cap="shell" data-cap-pref="cap-rail-specimen-logo">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main">
<span class="cap-shell-logo" aria-hidden="true"><svg viewBox="0 0 24 28" width="24" height="28" focusable="false"><rect x="0" y="2" width="24" height="24" rx="6" fill="var(--accent)" /><path d="M7 14h10M12 9v10" stroke="var(--surface)" stroke-width="2.4" stroke-linecap="round" /></svg></span> example.org <small>sample</small>
</a>
<div class="cap-shell-spacer"></div>
<span class="cap-muted" data-hide="phone">Updated 40 seconds ago</span>
<div class="cap-shell-actions">
<button type="button" class="cap-btn" data-hide="phone">Commands <kbd>Ctrl K</kbd></button>
<fieldset class="cap-theme" data-cap="theme-switch" data-cap-pref="cap-theme-specimen-logo">
<legend class="cap-sr-only">Theme</legend>
<div class="cap-theme-options">
<label><input type="radio" name="theme-logo" value="light" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" /><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1" /></svg><span class="cap-theme-text">Light</span></label>
<label><input type="radio" name="theme-logo" value="dark" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 9.3A5.5 5.5 0 0 1 6.7 2.5a5.5 5.5 0 1 0 6.8 6.8z" /></svg><span class="cap-theme-text">Dark</span></label>
</div>
</fieldset>
<a class="cap-btn cap-shell-settings" data-icon-only data-hide="phone" href="#cap-main" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M3.4 12.6l1.4-1.4M11.2 4.8l1.4-1.4" /></svg></a>
<button type="button" class="cap-btn">Sign out</button>
</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<div class="cap-shell-group" role="group" aria-labelledby="g-watch-logo">
<div class="cap-shell-group-label" id="g-watch-logo">Watch</div>
<a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg><span class="cap-shell-label">Overview</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main" aria-label="Sites, 2 down or degraded"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-label">Sites</span> <span class="cap-shell-count" data-tone="crit">2</span></a>
<a href="#cap-main" aria-label="Queue, 3 blocked"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg><span class="cap-shell-label">Queue</span> <span class="cap-shell-count" data-tone="warn">3</span></a>
</div>
<div class="cap-shell-group" role="group" aria-labelledby="g-record-logo">
<div class="cap-shell-group-label" id="g-record-logo">Record</div>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M3 2h10v12H3z" opacity=".35" /><path fill="currentColor" d="M5 5h6v1.5H5zM5 8h6v1.5H5z" /></svg><span class="cap-shell-label">Activity</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" d="m3.5 8.5 3 3 6-7" /></svg><span class="cap-shell-label">Reports</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-label">Backups</span> <span class="cap-shell-count"></span></a>
</div>
<div class="cap-shell-foot">
<div class="cap-shell-hint">
<button type="button" class="cap-shell-linkish"><span>Command menu</span><span><kbd>Ctrl</kbd> <kbd>K</kbd></span></button>
<button type="button" class="cap-shell-linkish"><span>Shortcuts</span><kbd>?</kbd></button>
</div>
<button type="button" class="cap-shell-toggle" data-cap-part="rail-toggle" aria-expanded="true" aria-controls="cap-rail"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M2.5 2.5h11v11h-11zM6 2.5v11M10.5 6 8.5 8l2 2" /></svg><span class="cap-shell-label">Collapse menu</span><kbd aria-hidden="true">[</kbd></button>
</div>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Overview</h1>
<p>The page's own content sits here, and the document scrolls. Activity shows hover and Backups shows pressed; keyboard focus is the 2 px ring.</p>
</div>
</main>
<nav class="cap-shell-tabs" aria-label="Sections">
<a href="#cap-main" aria-current="page">Overview</a><a href="#cap-main" aria-label="Sites, 2 down or degraded">Sites <span class="cap-count cap-shell-badge" data-tone="crit">2</span></a><a href="#cap-main">Queue</a><a href="#cap-main">Activity</a>
</nav>
</div>
Copy
View code
The logo alone: the link is named by brandLabel
<div class="cap-shell" data-cap="shell" data-cap-pref="cap-rail-specimen-logo-only">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main" aria-label="example.org">
<span class="cap-shell-logo" aria-hidden="true"><svg viewBox="0 0 120 28" width="120" height="28" focusable="false"><rect x="0" y="2" width="24" height="24" rx="6" fill="var(--accent)" /><path d="M7 14h10M12 9v10" stroke="var(--surface)" stroke-width="2.4" stroke-linecap="round" /><text x="32" y="20" font-size="15" font-weight="800" fill="currentColor" font-family="inherit">example</text></svg></span>
</a>
<div class="cap-shell-spacer"></div>
<span class="cap-muted" data-hide="phone">Updated 40 seconds ago</span>
<div class="cap-shell-actions">
<button type="button" class="cap-btn" data-hide="phone">Commands <kbd>Ctrl K</kbd></button>
<fieldset class="cap-theme" data-cap="theme-switch" data-cap-pref="cap-theme-specimen-logo-only">
<legend class="cap-sr-only">Theme</legend>
<div class="cap-theme-options">
<label><input type="radio" name="theme-logo-only" value="light" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" /><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1" /></svg><span class="cap-theme-text">Light</span></label>
<label><input type="radio" name="theme-logo-only" value="dark" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 9.3A5.5 5.5 0 0 1 6.7 2.5a5.5 5.5 0 1 0 6.8 6.8z" /></svg><span class="cap-theme-text">Dark</span></label>
</div>
</fieldset>
<a class="cap-btn cap-shell-settings" data-icon-only data-hide="phone" href="#cap-main" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M3.4 12.6l1.4-1.4M11.2 4.8l1.4-1.4" /></svg></a>
<button type="button" class="cap-btn">Sign out</button>
</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<div class="cap-shell-group" role="group" aria-labelledby="g-watch-logo-only">
<div class="cap-shell-group-label" id="g-watch-logo-only">Watch</div>
<a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg><span class="cap-shell-label">Overview</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main" aria-label="Sites, 2 down or degraded"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-label">Sites</span> <span class="cap-shell-count" data-tone="crit">2</span></a>
<a href="#cap-main" aria-label="Queue, 3 blocked"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg><span class="cap-shell-label">Queue</span> <span class="cap-shell-count" data-tone="warn">3</span></a>
</div>
<div class="cap-shell-group" role="group" aria-labelledby="g-record-logo-only">
<div class="cap-shell-group-label" id="g-record-logo-only">Record</div>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M3 2h10v12H3z" opacity=".35" /><path fill="currentColor" d="M5 5h6v1.5H5zM5 8h6v1.5H5z" /></svg><span class="cap-shell-label">Activity</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" d="m3.5 8.5 3 3 6-7" /></svg><span class="cap-shell-label">Reports</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-label">Backups</span> <span class="cap-shell-count"></span></a>
</div>
<div class="cap-shell-foot">
<div class="cap-shell-hint">
<button type="button" class="cap-shell-linkish"><span>Command menu</span><span><kbd>Ctrl</kbd> <kbd>K</kbd></span></button>
<button type="button" class="cap-shell-linkish"><span>Shortcuts</span><kbd>?</kbd></button>
</div>
<button type="button" class="cap-shell-toggle" data-cap-part="rail-toggle" aria-expanded="true" aria-controls="cap-rail"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M2.5 2.5h11v11h-11zM6 2.5v11M10.5 6 8.5 8l2 2" /></svg><span class="cap-shell-label">Collapse menu</span><kbd aria-hidden="true">[</kbd></button>
</div>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Overview</h1>
<p>The page's own content sits here, and the document scrolls. Activity shows hover and Backups shows pressed; keyboard focus is the 2 px ring.</p>
</div>
</main>
<nav class="cap-shell-tabs" aria-label="Sections">
<a href="#cap-main" aria-current="page">Overview</a><a href="#cap-main" aria-label="Sites, 2 down or degraded">Sites <span class="cap-count cap-shell-badge" data-tone="crit">2</span></a><a href="#cap-main">Queue</a><a href="#cap-main">Activity</a>
</nav>
</div>
Copy
View code
Collapsed to icons, Settings current
<div class="cap-shell" data-cap="shell" data-rail="collapsed" data-cap-pref="cap-rail-specimen-collapsed">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main">
<svg width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path fill="var(--accent)" d="M10 1 17.8 5.5v9L10 19l-7.8-4.5v-9z" /><path fill="var(--surface)" d="M10 5.4 14 7.7v4.6L10 14.6 6 12.3V7.7z" /></svg>
Capsomer <small>0.2.0</small>
</a>
<div class="cap-shell-spacer"></div>
<div class="cap-shell-actions">
<fieldset class="cap-theme" data-cap="theme-switch" data-cap-pref="cap-theme-specimen-collapsed">
<legend class="cap-sr-only">Theme</legend>
<div class="cap-theme-options">
<label><input type="radio" name="theme-collapsed" value="light" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" /><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1" /></svg><span class="cap-theme-text">Light</span></label>
<label><input type="radio" name="theme-collapsed" value="dark" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 9.3A5.5 5.5 0 0 1 6.7 2.5a5.5 5.5 0 1 0 6.8 6.8z" /></svg><span class="cap-theme-text">Dark</span></label>
</div>
</fieldset>
<a class="cap-btn cap-shell-settings" data-icon-only href="#cap-main" aria-label="Settings" aria-current="page"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M3.4 12.6l1.4-1.4M11.2 4.8l1.4-1.4" /></svg></a>
</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg><span class="cap-shell-label">Components</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main" aria-label="Tests, 1 failing"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" d="m3.5 8.5 3 3 6-7" /></svg><span class="cap-shell-label">Tests</span> <span class="cap-shell-count" data-tone="crit">1</span></a>
<a href="#cap-main" aria-label="Queue, 3 blocked"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg><span class="cap-shell-label">Queue</span> <span class="cap-shell-count" data-tone="warn">3</span></a>
<div class="cap-shell-foot">
<div class="cap-shell-hint">
<button type="button" class="cap-shell-railbtn"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.5" fill="none" stroke="currentColor" stroke-width="1.5" /><path d="m10.5 10.5 3 3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" /></svg><span class="cap-shell-label">Command menu</span></button>
<button type="button" class="cap-shell-railbtn"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M1.5 4.5h13v7h-13zM4 8h8" /></svg><span class="cap-shell-label">Shortcuts</span></button>
</div>
<button type="button" class="cap-shell-toggle" data-cap-part="rail-toggle" aria-expanded="false" aria-controls="cap-rail"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M2.5 2.5h11v11h-11zM6 2.5v11M10.5 6 8.5 8l2 2" /></svg><span class="cap-shell-label">Expand menu</span><kbd aria-hidden="true">[</kbd></button>
</div>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Settings</h1>
<p>Hover or focus an icon to see its name. Esc hides it. A count is a dot, and the name still says how many.</p>
</div>
</main>
</div>
Copy
View code
Collapsed, a name shown
<div class="cap-shell" data-cap="shell" data-rail="collapsed" data-cap-pref="cap-rail-specimen-collapsed-tip">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main">
<svg width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path fill="var(--accent)" d="M10 1 17.8 5.5v9L10 19l-7.8-4.5v-9z" /><path fill="var(--surface)" d="M10 5.4 14 7.7v4.6L10 14.6 6 12.3V7.7z" /></svg>
Capsomer
</a>
<div class="cap-shell-spacer"></div>
<div class="cap-shell-actions">
<fieldset class="cap-theme" data-cap="theme-switch" data-cap-pref="cap-theme-specimen-collapsed-tip">
<legend class="cap-sr-only">Theme</legend>
<div class="cap-theme-options">
<label><input type="radio" name="theme-collapsed-tip" value="light" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" /><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1" /></svg><span class="cap-theme-text">Light</span></label>
<label><input type="radio" name="theme-collapsed-tip" value="dark" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 9.3A5.5 5.5 0 0 1 6.7 2.5a5.5 5.5 0 1 0 6.8 6.8z" /></svg><span class="cap-theme-text">Dark</span></label>
</div>
</fieldset>
<a class="cap-btn cap-shell-settings" data-icon-only data-hide="phone" href="#cap-main" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M3.4 12.6l1.4-1.4M11.2 4.8l1.4-1.4" /></svg></a>
</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg><span class="cap-shell-label">Components</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main" aria-label="Tests, 1 failing"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" d="m3.5 8.5 3 3 6-7" /></svg><span class="cap-shell-label">Tests</span> <span class="cap-shell-count" data-tone="crit">1</span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg><span class="cap-shell-label">Queue</span> <span class="cap-shell-count"></span></a>
<div class="cap-shell-foot">
<div class="cap-shell-hint">
<button type="button" class="cap-shell-railbtn"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="7" cy="7" r="4.5" fill="none" stroke="currentColor" stroke-width="1.5" /><path d="m10.5 10.5 3 3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" /></svg><span class="cap-shell-label">Command menu</span></button>
<button type="button" class="cap-shell-railbtn"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M1.5 4.5h13v7h-13zM4 8h8" /></svg><span class="cap-shell-label">Shortcuts</span></button>
</div>
<button type="button" class="cap-shell-toggle" data-cap-part="rail-toggle" aria-expanded="false" aria-controls="cap-rail"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M2.5 2.5h11v11h-11zM6 2.5v11M10.5 6 8.5 8l2 2" /></svg><span class="cap-shell-label">Expand menu</span><kbd aria-hidden="true">[</kbd></button>
</div>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Components</h1>
<p>Tests is hovered: its name shows in a tooltip beside its icon.</p>
</div>
</main>
</div>
Copy
View code
Comfortable density
<div class="cap-shell" data-cap="shell" data-density="comfortable" data-cap-pref="cap-rail-specimen-comfortable">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main">
<svg width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path fill="var(--accent)" d="M10 1 17.8 5.5v9L10 19l-7.8-4.5v-9z" /><path fill="var(--surface)" d="M10 5.4 14 7.7v4.6L10 14.6 6 12.3V7.7z" /></svg>
Portal
</a>
<div class="cap-shell-spacer"></div>
<div class="cap-shell-actions">
<fieldset class="cap-theme" data-cap="theme-switch" data-cap-pref="cap-theme-specimen-comfortable">
<legend class="cap-sr-only">Theme</legend>
<div class="cap-theme-options">
<label><input type="radio" name="theme-comfortable" value="light" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" /><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1" /></svg><span class="cap-theme-text">Light</span></label>
<label><input type="radio" name="theme-comfortable" value="dark" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 9.3A5.5 5.5 0 0 1 6.7 2.5a5.5 5.5 0 1 0 6.8 6.8z" /></svg><span class="cap-theme-text">Dark</span></label>
</div>
</fieldset>
<a class="cap-btn cap-shell-settings" data-icon-only data-hide="phone" href="#cap-main" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M3.4 12.6l1.4-1.4M11.2 4.8l1.4-1.4" /></svg></a>
<button type="button" class="cap-btn">Sign out</button>
</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<div class="cap-shell-group" role="group" aria-labelledby="g-comfy">
<div class="cap-shell-group-label" id="g-comfy">Watch</div>
<a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg><span class="cap-shell-label">Overview</span> <span class="cap-shell-count"></span></a>
<a href="#cap-main" aria-label="Sites, 2 down or degraded"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-label">Sites</span> <span class="cap-shell-count" data-tone="crit">2</span></a>
<a href="#cap-main" aria-label="Queue, 3 blocked"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg><span class="cap-shell-label">Queue</span> <span class="cap-shell-count" data-tone="warn">3</span></a>
</div>
<div class="cap-shell-foot">
<div class="cap-shell-hint">
<button type="button" class="cap-shell-linkish"><span>Command menu</span><span><kbd>Ctrl</kbd> <kbd>K</kbd></span></button>
<button type="button" class="cap-shell-linkish"><span>Shortcuts</span><kbd>?</kbd></button>
</div>
<button type="button" class="cap-shell-toggle" data-cap-part="rail-toggle" aria-expanded="true" aria-controls="cap-rail"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M2.5 2.5h11v11h-11zM6 2.5v11M10.5 6 8.5 8l2 2" /></svg><span class="cap-shell-label">Collapse menu</span><kbd aria-hidden="true">[</kbd></button>
</div>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Overview</h1>
<p>data-density=comfortable on the shell makes the items, the counts and the page padding roomier.</p>
</div>
</main>
</div>
Copy
View code
Phone width, with the tab bar
<div class="cap-shell" data-cap="shell" data-cap-pref="cap-rail-specimen-phone">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main">
<svg width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path fill="var(--accent)" d="M10 1 17.8 5.5v9L10 19l-7.8-4.5v-9z" /><path fill="var(--surface)" d="M10 5.4 14 7.7v4.6L10 14.6 6 12.3V7.7z" /></svg>
Portal
</a>
<div class="cap-shell-spacer"></div>
<div class="cap-shell-actions">
<fieldset class="cap-theme" data-cap="theme-switch" data-cap-pref="cap-theme-specimen-phone">
<legend class="cap-sr-only">Theme</legend>
<div class="cap-theme-options">
<label><input type="radio" name="theme-phone" value="light" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" /><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1" /></svg><span class="cap-theme-text">Light</span></label>
<label><input type="radio" name="theme-phone" value="dark" /><svg class="cap-theme-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 9.3A5.5 5.5 0 0 1 6.7 2.5a5.5 5.5 0 1 0 6.8 6.8z" /></svg><span class="cap-theme-text">Dark</span></label>
</div>
</fieldset>
<a class="cap-btn cap-shell-settings" data-icon-only data-hide="phone" href="#cap-main" aria-label="Settings"><svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M3.4 12.6l1.4-1.4M11.2 4.8l1.4-1.4" /></svg></a>
</div>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<a href="#cap-main" aria-current="page"><span class="cap-shell-label">Overview</span> <span class="cap-shell-count"></span></a>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Overview</h1>
<p>At phone width the left menu gives way to a tab bar of four views and More. Settings is under More.</p>
</div>
</main>
<nav class="cap-shell-tabs" aria-label="Sections">
<a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg>Overview</a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg>Queue</a>
<a href="#cap-main" aria-label="Sites, 2 down or degraded"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5" /></svg>Sites <span class="cap-count cap-shell-badge" data-tone="crit">2</span></a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M3 2h10v12H3z" opacity=".35" /><path fill="currentColor" d="M5 5h6v1.5H5zM5 8h6v1.5H5z" /></svg>Activity</a>
<button type="button" data-cap-part="more" aria-haspopup="dialog" aria-expanded="false" aria-controls="cap-more"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="3" cy="8" r="1.4" fill="currentColor" /><circle cx="8" cy="8" r="1.4" fill="currentColor" /><circle cx="13" cy="8" r="1.4" fill="currentColor" /></svg>More</button>
</nav>
<dialog class="cap-dialog cap-shell-more" data-cap="dialog" data-placement="bottom" id="cap-more" aria-labelledby="cap-more-title">
<div class="cap-dialog-header">
<h2 class="cap-dialog-title" id="cap-more-title">More views</h2>
</div>
<div class="cap-dialog-body">
<nav aria-labelledby="cap-more-title">
<ul class="cap-shell-more-list">
<li><a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg><span class="cap-shell-more-name">Namespaces</span> <span class="cap-shell-count">1 paused</span></a></li>
<li><a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-more-name">Backups</span></a></li>
<li><a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-more-name">Settings</span></a></li>
</ul>
</nav>
</div>
<button type="button" class="cap-btn cap-dialog-close" data-variant="quiet" data-icon-only data-cap-part="close" aria-label="Close"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" focusable="false"><path d="M4 4l8 8M12 4l-8 8" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" /></svg></button>
</dialog>
</div>
Copy
View code
Phone width, current view is under More
<div class="cap-shell" data-cap="shell" data-cap-pref="cap-rail-specimen-phone-more">
<a class="cap-shell-skip" href="#cap-main">Skip to content</a>
<header class="cap-shell-top">
<a class="cap-shell-brand" href="#cap-main">
<svg width="20" height="20" viewBox="0 0 20 20" aria-hidden="true"><path fill="var(--accent)" d="M10 1 17.8 5.5v9L10 19l-7.8-4.5v-9z" /><path fill="var(--surface)" d="M10 5.4 14 7.7v4.6L10 14.6 6 12.3V7.7z" /></svg>
Portal
</a>
</header>
<nav class="cap-shell-rail" id="cap-rail" aria-label="Sections">
<a href="#cap-main" aria-current="page"><span class="cap-shell-label">Settings</span> <span class="cap-shell-count"></span></a>
</nav>
<main class="cap-shell-main" id="cap-main" tabindex="-1">
<div class="cap-shell-page">
<h1>Settings</h1>
<p>Settings is not a tab, so the More tab is the current one.</p>
</div>
</main>
<nav class="cap-shell-tabs" aria-label="Sections">
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z" /></svg>Overview</a>
<a href="#cap-main"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M2 3h12v2H2zM2 7h12v2H2zM2 11h12v2H2z" /></svg>Queue</a>
<button type="button" data-cap-part="more" aria-haspopup="dialog" aria-expanded="false" aria-controls="cap-more" aria-current="true"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="3" cy="8" r="1.4" fill="currentColor" /><circle cx="8" cy="8" r="1.4" fill="currentColor" /><circle cx="13" cy="8" r="1.4" fill="currentColor" /></svg>More</button>
</nav>
<dialog class="cap-dialog cap-shell-more" data-cap="dialog" data-placement="bottom" id="cap-more" aria-labelledby="cap-more-title">
<div class="cap-dialog-header">
<h2 class="cap-dialog-title" id="cap-more-title">More views</h2>
</div>
<div class="cap-dialog-body">
<nav aria-labelledby="cap-more-title">
<ul class="cap-shell-more-list">
<li><a href="#cap-main" aria-current="page"><svg class="cap-shell-icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="2.4" fill="none" stroke="currentColor" stroke-width="1.5" /></svg><span class="cap-shell-more-name">Settings</span></a></li>
</ul>
</nav>
</div>
<button type="button" class="cap-btn cap-dialog-close" data-variant="quiet" data-icon-only data-cap-part="close" aria-label="Close"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" focusable="false"><path d="M4 4l8 8M12 4l-8 8" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" /></svg></button>
</dialog>
</div>
Copy
View code
API reference
Shell Prop Type Required Does brandReactNodeYes The name beside the logo. Leave it null when the logo is the whole brand, and give brandLabel. brandHrefstringlogoReactNodeThe site's logo (an <img alt=""> or an <svg>), before the name: held to the bar's height, in proportion, and hidden from a screen reader because the name or brandLabel is the link's name. brandLabelstringThe brand link's name when brand is empty (the logo alone). navShellEntry[]Yes tabsShellEntry[]At most four: the wrapper adds More as the fifth when more is given. moreShellEntry[]The views the tab bar has no room for, listed in the More sheet. current on one of them marks the More tab as current. The sheet's count reads "1 paused" (count, then countNote). moreLabelstringmoreIconReactNodenavLabelstringstatusReactNodeThe top bar, left to right after the brand: a status, then actions. Put the theme switch, then Settings, then Sign out (where there is one) last in actions. actionsReactNoderailFootReactNodeprefKeystringrenderLink(props: LinkProps) => ReactNodeA router's link component; a plain <a> by default. collapsedbooleanControlled collapse, for an app that binds a key to it. onCollapsedChange(collapsed: boolean) => voidchildrenReactNodeYes
Functions Function Signature Does useCollapsedPref(prefKey: string, controlled: boolean | undefined, onChange: ((next: boolean) => void) | undefined): [boolean, (next: boolean) => void]The rail's collapsed state: the prop when the app controls it, else the stored preference. setRail(shell: HTMLElement, collapsed: boolean, remember?: boolean): voidCollapses or expands the rail of one shell, and keeps its toggle's state and name true. toggleRail(shell: HTMLElement): voidopenMore(shell: HTMLElement): voidThe phone tab bar's More sheet: the shared dialog (components/dialog) as a bottom sheet, which the More button opens. The dialog gives Esc, the inert page, the backdrop click, the focus trap and the hand-back of focus to More; this adds aria-expanded on the button. closeMore(shell: HTMLElement): voidreadDensity(key?: string): Density | nullapplyDensity(choice: Density, opts?: { key?: string | undefined; remember?: boolean | undefined; }): voidapplyStoredDensity(key?: string): Density | nullenhance(root?: ParentNode): () => voidAttaches to every [data-cap="shell"] under root that is not attached yet. Returns a function that detaches them all.
Parts and data attributes Class Is .cap-shellthe root .cap-shell-actionsa part .cap-shell-badgea part .cap-shell-branda part .cap-shell-counta part .cap-shell-foota part .cap-shell-groupa part .cap-shell-group-labela part .cap-shell-hinta part .cap-shell-icona part .cap-shell-labela part .cap-shell-linkisha part .cap-shell-logoa part .cap-shell-maina part .cap-shell-morea part .cap-shell-more-lista part .cap-shell-more-namea part .cap-shell-pagea part .cap-shell-raila part .cap-shell-railbtna part .cap-shell-settingsa part .cap-shell-spacera part .cap-shell-tabsa part .cap-shell-togglea part .cap-shell-topa part
Attribute Values data-hidephonedata-railcollapseddata-tiphiddendata-tonecrit warn
State Read from :activethe platform :emptythe platform :focusthe platform :focus-visiblethe platform :hoverthe platform [aria-current="page"]an attribute [aria-current="true"]an attribute [aria-current]an attribute
Accessibility
Key Does Tab The skip link first, then the top bar, the rail, the main region Enter on the skip link Moves focus to the main region Enter or Space on the collapse button Collapses or expands the rail Esc Hides a collapsed entry's shown name until the pointer or focus moves on Enter or Space on More (phone) Opens the More sheet; focus moves into it Tab, Shift Tab in the More sheet Moves among its links and Close; focus stays in the sheet Enter or Space on Close in the More sheet, or a press on the backdrop Closes it; focus returns to More Esc in the More sheet Closes it; focus returns to More Enter on a link in the More sheet Goes to that view and closes the sheet [Collapses or expands the rail, when the app binds it through the shortcut registry
Two navigation landmarks with the same name ("Sections"); only one is displayed at any width, so a screen reader meets one. The More sheet is the shared dialog (a native modal dialog) named "More views", so the page behind it is inert, Esc closes it and focus returns to the More button. Its counts are --muted, since --dim on the active tint is 3.8:1 in dark. The More tab states its popup (aria-haspopup="dialog") and whether it is open (aria-expanded); the current tab is never conveyed by color alone (the accent plus aria-current, and an underline in forced colors). Collapsed names are clipped, not removed, so the links keep their names. A shown name is a child of its link, so the pointer can move onto it without it closing, and Esc hides it (WCAG 1.4.13). Because a scrolling box would clip it, a collapsed rail does not scroll; its icons fit the height. Counts are part of the link's accessible name. The top bar is sticky and the document scrolls, with scroll-padding-top for the bar, so a focused control is never hidden under it (WCAG 2.4.11). Forced colors: the current entry gains an outline, because its tinted background is removed.