Skip to content

Status

A status as a shape, a word and a color together, as a word or a badge.

<ul class="status-sample-list" aria-label="Statuses as words">
  <li><span class="cap-status" data-tone="crit"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M5 1h6l4 4v6l-4 4H5l-4-4V5zM7.2 4h1.6v5H7.2zM7.2 10.4h1.6V12H7.2z"/></svg>Critical</span></li>
  <li><span class="cap-status" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1.2 15.4 14H.6zM7.3 6h1.4v4H7.3zM7.3 11h1.4v1.4H7.3z"/></svg>Warning</span></li>
  <li><span class="cap-status" data-tone="info"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><rect x="1.5" y="1.5" width="13" height="13" rx="2" fill="none" stroke="currentColor" stroke-width="1.6"/><path fill="currentColor" d="M7.2 7h1.6v5H7.2zM7.2 4h1.6v1.7H7.2z"/></svg>Notice</span></li>
  <li><span class="cap-status" data-tone="ok"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1zM3.9 9l3 3 5.2-5.6-1.4-1.4-3.8 4.2-1.6-1.6z"/></svg>Healthy</span></li>
  <li><span class="cap-status" data-tone="info"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6" opacity="0.35"/><path fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" d="M8 1.8a6.2 6.2 0 0 1 6.2 6.2"/></svg>Running</span></li>
  <li><span class="cap-status" data-tone="nodata"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M5 8h6" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>No data</span></li>
</ul>

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/status.css";
import { glyphParts, glyphHtml, statusHtml } from "capsomer/behavior/status";

Usage

<span class="cap-status" data-tone="crit">
  <svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M5 1h6l4 4v6l-4 4H5l-4-4V5zM7.2 4h1.6v5H7.2zM7.2 10.4h1.6V12H7.2z"/></svg>Critical
</span>

<span class="cap-pill" data-tone="warn">[warning glyph]Needs you</span>

<span class="cap-status" data-tone="nodata">[no data glyph]No data</span>
<span class="cap-status-reason">The uptime checker has not reported since 09:00.</span>
<span class="cap-pill" data-variant="secondary">Draft</span>
<a class="cap-pill" data-variant="outline" href="/mentions?state=waiting">Waiting 4</a>
<span class="cap-pill" data-variant="outline" data-tone="ok">[ok glyph]Healthy</span>
<span class="cap-status" data-tone="warn" data-wrap>[blocked glyph]Held until a person approves the change</span>
<svg class="cap-status-glyph" data-tone="ok" viewBox="0 0 16 16" aria-hidden="true" focusable="false">...</svg> example.com<span class="cap-sr-only"> is up</span>
<span class="cap-pill" data-variant="accent" data-family="purple">Win-back</span>
<span class="cap-pill" data-variant="outline" data-series="2"><span class="cap-pill-dot" aria-hidden="true"></span>In review</span>

Examples

Every tone as a pill

<ul class="status-sample-list" aria-label="Statuses as pills">
  <li><span class="cap-pill" data-tone="crit"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M5 1h6l4 4v6l-4 4H5l-4-4V5zM7.2 4h1.6v5H7.2zM7.2 10.4h1.6V12H7.2z"/></svg>Failed</span></li>
  <li><span class="cap-pill" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1.2 15.4 14H.6zM7.3 6h1.4v4H7.3zM7.3 11h1.4v1.4H7.3z"/></svg>Needs you</span></li>
  <li><span class="cap-pill" data-tone="info"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><rect x="1.5" y="1.5" width="13" height="13" rx="2" fill="none" stroke="currentColor" stroke-width="1.6"/><path fill="currentColor" d="M7.2 7h1.6v5H7.2zM7.2 4h1.6v1.7H7.2z"/></svg>3 suggestions</span></li>
  <li><span class="cap-pill" data-tone="ok"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1zM3.9 9l3 3 5.2-5.6-1.4-1.4-3.8 4.2-1.6-1.6z"/></svg>Deployed</span></li>
  <li><span class="cap-pill" data-tone="info"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6" opacity="0.35"/><path fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" d="M8 1.8a6.2 6.2 0 0 1 6.2 6.2"/></svg>Working</span></li>
  <li><span class="cap-pill" data-tone="nodata"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M5 8h6" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>No data</span></li>
</ul>

States and kinds with a mark of their own

<p class="cap-muted">The tone sets the color; the shape names the state (queued, unknown, blocked) or the kind of item (a question, a pull request, a report, a proposal, a site that is down). The quiet gray, <code>data-tone="muted"</code>, is for a state that is neither good nor bad.</p>
<ul class="status-sample-list" aria-label="State marks as words" id="sample-marks">
  <li><span class="cap-status" data-tone="muted"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>Queued</span></li>
  <li><span class="cap-status" data-tone="muted"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M6.1 6.4a1.95 1.95 0 1 1 2.9 1.7c-.6.3-1 .7-1 1.4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><circle cx="8" cy="11.7" r=".9" fill="currentColor"/></svg>Could not be measured</span></li>
  <li><span class="cap-status" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M4 1.5h8A2.5 2.5 0 0 1 14.5 4v8a2.5 2.5 0 0 1-2.5 2.5H4A2.5 2.5 0 0 1 1.5 12V4A2.5 2.5 0 0 1 4 1.5zM5.7 4.8h1.5v6.4H5.7zM8.8 4.8h1.5v6.4H8.8z"/></svg>Blocked</span></li>
  <li><span class="cap-status" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="currentColor" fill-opacity="0.18" stroke="currentColor" stroke-width="1.6"/><path d="M6.1 6.4a1.95 1.95 0 1 1 2.9 1.7c-.6.3-1 .7-1 1.4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><circle cx="8" cy="11.7" r=".9" fill="currentColor"/></svg>Needs an answer</span></li>
  <li><span class="cap-status" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="4.3" cy="3.4" r="1.8"/><circle cx="4.3" cy="12.6" r="1.8"/><circle cx="11.7" cy="12.6" r="1.8"/><path d="M4.3 5.2v5.6M11.7 10.8V7.1A2.5 2.5 0 0 0 9.2 4.6H7.4M8.9 3 7.3 4.6l1.6 1.6"/></g></svg>Pull request open</span></li>
  <li><span class="cap-status" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3.4 14.5V2M3.4 2.5h8.7l-1.8 3 1.8 3H3.4" fill="currentColor" fill-opacity="0.18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>Report waiting</span></li>
  <li><span class="cap-status" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3.4 1.7h6.3l2.9 2.9v9.7H3.4z" fill="currentColor" fill-opacity="0.18" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/><path d="M5.7 8h4.6M5.7 10.9h4.6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>Proposal waiting</span></li>
  <li><span class="cap-status" data-tone="crit"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1zM7.2 4h1.6v4.1l1.5-1.5 1.1 1.1L8 11 4.6 7.7l1.1-1.1 1.5 1.5z"/></svg>Site down</span></li>
</ul>
<ul class="status-sample-list" aria-label="State marks as pills" id="sample-mark-pills">
  <li><span class="cap-pill" data-tone="muted"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>Queued</span></li>
  <li><span class="cap-pill" data-tone="muted"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M6.1 6.4a1.95 1.95 0 1 1 2.9 1.7c-.6.3-1 .7-1 1.4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><circle cx="8" cy="11.7" r=".9" fill="currentColor"/></svg>Could not be measured</span></li>
  <li><span class="cap-pill" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M4 1.5h8A2.5 2.5 0 0 1 14.5 4v8a2.5 2.5 0 0 1-2.5 2.5H4A2.5 2.5 0 0 1 1.5 12V4A2.5 2.5 0 0 1 4 1.5zM5.7 4.8h1.5v6.4H5.7zM8.8 4.8h1.5v6.4H8.8z"/></svg>Blocked</span></li>
  <li><span class="cap-pill" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="currentColor" fill-opacity="0.18" stroke="currentColor" stroke-width="1.6"/><path d="M6.1 6.4a1.95 1.95 0 1 1 2.9 1.7c-.6.3-1 .7-1 1.4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><circle cx="8" cy="11.7" r=".9" fill="currentColor"/></svg>Needs an answer</span></li>
</ul>

A phrase that wraps

<p class="cap-muted">A hold reason is a sentence, so it wraps in its own column (<code>data-wrap</code>) and the glyph stays by its first line.</p>
<div class="status-sample-narrow">
  <span class="cap-status" data-tone="warn" data-wrap id="sample-wrap"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M4 1.5h8A2.5 2.5 0 0 1 14.5 4v8a2.5 2.5 0 0 1-2.5 2.5H4A2.5 2.5 0 0 1 1.5 12V4A2.5 2.5 0 0 1 4 1.5zM5.7 4.8h1.5v6.4H5.7zM8.8 4.8h1.5v6.4H8.8z"/></svg>Held until a person approves the change to the billing settings for example.com</span>
</div>

A glyph on its own

<p class="cap-muted">A status icon beside a name, with no word of its own, takes its tone's color (<code>data-tone</code> on the glyph). The name beside it, or a hidden word, says the state.</p>
<ul class="status-sample-list" aria-label="Glyphs on their own" id="sample-glyph">
  <li><svg class="cap-status-glyph" data-tone="ok" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1zM3.9 9l3 3 5.2-5.6-1.4-1.4-3.8 4.2-1.6-1.6z"/></svg> example.com<span class="cap-sr-only"> is up</span></li>
  <li><svg class="cap-status-glyph" data-tone="crit" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M5 1h6l4 4v6l-4 4H5l-4-4V5zM7.2 4h1.6v5H7.2zM7.2 10.4h1.6V12H7.2z"/></svg> api.example.com<span class="cap-sr-only"> is down</span></li>
</ul>

Accent and series badges

<p class="cap-muted">The accent variant is a category that is not a state, with no glyph; <code>data-family</code> gives it another family's accent. A series dot colors a label a person made, the word beside it carrying the meaning.</p>
<div class="cap-specimen-row" id="sample-accent">
  <span class="cap-pill" data-variant="accent">Win-back</span>
  <span class="cap-pill" data-variant="accent" data-family="purple">Win-back, in the purple family</span>
</div>
<div class="cap-specimen-row" id="sample-series">
  <span class="cap-pill" data-variant="outline" data-series="1"><span class="cap-pill-dot" aria-hidden="true"></span>Draft</span>
  <span class="cap-pill" data-variant="outline" data-series="2"><span class="cap-pill-dot" aria-hidden="true"></span>In review</span>
  <span class="cap-pill" data-variant="outline" data-series="3"><span class="cap-pill-dot" aria-hidden="true"></span>Revised</span>
  <span class="cap-pill" data-variant="outline" data-series="4"><span class="cap-pill-dot" aria-hidden="true"></span>Final</span>
</div>
<h2 id="s-tag">Tag badges</h2>
<p class="cap-muted">A tag is set in the site's tag face (<code>--tag-*</code>): the tone's tint with an edge in its own color, a quiet hairline label with no tone, or a family's accent. These set mono, upper case and no glyph, as Foxhound does.</p>
<div class="cap-specimen-row" id="sample-tag" style="--tag-face: var(--mono); --tag-case: uppercase; --tag-tracking: var(--tracking-widest); --tag-weight: var(--weight-regular)">
  <span class="cap-pill" data-variant="tag" data-tone="ok">Retries automatically</span>
  <span class="cap-pill" data-variant="tag" data-tone="crit">Never retried</span>
  <span class="cap-pill" data-variant="tag">Needs card update</span>
  <span class="cap-pill" data-variant="tag" data-family="purple">Reactivated</span>
</div>

On a selected row

<div class="status-sample-row" id="sample-selected">
  <span class="cap-pill" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1.2 15.4 14H.6zM7.3 6h1.4v4H7.3zM7.3 11h1.4v1.4H7.3z"/></svg>Blocked</span>
  <span>job_7c21 rebuild the search index</span>
  <span class="cap-status" data-tone="crit"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M5 1h6l4 4v6l-4 4H5l-4-4V5zM7.2 4h1.6v5H7.2zM7.2 10.4h1.6V12H7.2z"/></svg>2 checks failing</span>
</div>

No data, with its reason

<p id="sample-reason"><span class="cap-status" data-tone="nodata"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M5 8h6" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>No data</span> <span class="cap-status-reason">The uptime checker has not reported since 09:00.</span></p>

No data in a table cell

<p id="sample-brief"><span class="cap-status" data-tone="nodata" title="No Cloudflare token for this site"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="6.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M5 8h6" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>No data<span class="cap-sr-only">: no Cloudflare token for this site</span></span></p>

Badge variants

<div class="cap-specimen-row" id="sample-variants">
  <span class="cap-pill" data-variant="default">Default</span>
  <span class="cap-pill" data-variant="secondary">Secondary</span>
  <span class="cap-pill" data-variant="outline">Outline</span>
  <span class="cap-pill" data-variant="destructive"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M5 1h6l4 4v6l-4 4H5l-4-4V5zM7.2 4h1.6v5H7.2zM7.2 10.4h1.6V12H7.2z"/></svg>Destructive</span>
  <span class="cap-pill" data-variant="ghost">Ghost</span>
  <a class="cap-pill" data-variant="link" href="#s-variants">Link</a>
</div>
<p>An outline or ghost badge with a tone keeps the tone's color.</p>
<div class="cap-specimen-row" id="sample-variant-tones">
  <span class="cap-pill" data-variant="outline" data-tone="ok"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1zM3.9 9l3 3 5.2-5.6-1.4-1.4-3.8 4.2-1.6-1.6z"/></svg>Healthy</span>
  <span class="cap-pill" data-variant="outline" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1.2 15.4 14H.6zM7.3 6h1.4v4H7.3zM7.3 11h1.4v1.4H7.3z"/></svg>Warning</span>
  <span class="cap-pill" data-variant="ghost" data-tone="crit"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M5 1h6l4 4v6l-4 4H5l-4-4V5zM7.2 4h1.6v5H7.2zM7.2 10.4h1.6V12H7.2z"/></svg>Critical</span>
</div>

A badge that is a link or a button: hover, disabled

<div class="cap-specimen-row" id="sample-interactive">
  <a class="cap-pill" data-variant="default" href="#s-interactive">Hover</a>
  <a class="cap-pill" data-variant="secondary" href="#s-interactive">Mentions 4</a>
  <button type="button" class="cap-pill" data-variant="outline">Filter: blocked</button>
  <button type="button" class="cap-pill" data-variant="ghost">Ghost hover</button>
  <a class="cap-pill" data-variant="link" href="#s-interactive">Link hover</a>
  <button type="button" class="cap-pill" data-variant="secondary" disabled>Disabled</button>
</div>

A count, with no glyph

<div class="cap-specimen-row">
  <span class="cap-pill" data-variant="default">3<span class="cap-sr-only"> waiting</span></span>
  <span class="cap-pill" data-variant="secondary">128<span class="cap-sr-only"> sites</span></span>
</div>

Comfortable density

<div class="cap-specimen-row" data-density="comfortable" id="sample-comfortable">
  <span class="cap-status" data-tone="ok"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1zM3.9 9l3 3 5.2-5.6-1.4-1.4-3.8 4.2-1.6-1.6z"/></svg>Healthy</span>
  <span class="cap-pill" data-tone="warn"><svg class="cap-status-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M8 1.2 15.4 14H.6zM7.3 6h1.4v4H7.3zM7.3 11h1.4v1.4H7.3z"/></svg>Warning</span>
  <span class="cap-pill" data-variant="default">Default</span>
  <span class="cap-pill" data-variant="outline">Outline</span>
</div>

API reference

Glyph

PropTypeRequiredDoes
nameGlyphNameYes
toneTone

Status

PropTypeRequiredDoes
toneToneYes
runningbooleanRunning is an info tone drawn with an arc.
childrenReactNodeYesThe word: "Critical", "Down", "2 blocked". Never empty: the word is the status.
glyphGlyphNameThe mark of a state or kind of item that has its own shape (queued, blocked, a pull request); the tone still sets the color. Without it the tone's own glyph.
reasonReactNodeNo data says why: "the counter has not reported since 09:00".
briefbooleanFor a table cell, where a sentence does not fit: the cell says the word and nothing more, the reason is read out by a screen reader (and shown on hover, when it is text), and the full sentence is in the row's detail. The Portal's NoData brief (design D18).
wrapbooleanA phrase that wraps in its own column (a hold reason) instead of staying on one line; the glyph stays at the first line.

Pill

PropTypeRequiredDoes
toneToneA status tone: the word and glyph on the tone's tint. Without a variant it is a status badge; with one, outline and ghost keep the tone's color.
variantBadgeVariantshadcn's badge variants. Leave out for the tinted status badge (or a quiet gray one).
runningbooleanRunning is an info tone drawn with an arc.
glyphGlyphName | falseThe mark of a state or kind that has its own shape; the tone sets the color. false leaves the glyph out, for a site whose badges are words alone: the word must then say the state.
series1 | 2 | 3 | 4 | 5 | 6 | 7 | 8A dot in the series color 1 to 8, before the word: a label the person colored (a status list's labels). The word carries the meaning; the dot only repeats it. Give it with a variant (outline for the quiet edge).
familystringThe color family of this badge's accent: "purple", "amber" and the rest of Capsomer's families. A site's own hue for the accent variant, kept in tokens.
childrenReactNodeYesThe word. A badge with a tone also draws that tone's glyph, so shape and word carry it.
hrefstringA link badge: a real <a>. Its hit area grows to the target size.
onClick() => voidA button badge. Give href or onClick, not both.

Functions

FunctionSignatureDoes
glyphParts(name: GlyphName): stringA glyph's inner elements as markup, for a page that draws it inside its own <svg> (a box in a graph at 12 px).
glyphHtml(name: GlyphName): stringThe glyph as the status draws it: hidden from assistive technology, since the word says it.
statusHtml(tone: Tone, label: string, options?: StatusHtmlOptions): stringThe status word, the same markup React's Status renders: the glyph, then the word, which is the accessible text and is never empty.
outcomeStatus(conclusion: string | null | undefined, labels?: Partial<Record<string, string>>): OutcomeThe conclusion of a run (a CI check, a build, a backup copy, a scheduled task) as a status. The words are GitHub's check-run conclusions and Cloudflare's build outcomes, which cover the rest: success and neutral are ok, skipped did not run (no data), canceled and timed out stopped before an answer (warning), and every other conclusion failed. No conclusion yet is running. A site that words a state its own way passes labels ("Built", "Green").

CSS variables

VariableDefault
--_bgvar(--nodata-soft)
--_fgvar(--muted)
--_linetransparent
--tag-casenone
--tag-edge45%
--tag-faceinherit
--tag-sizevar(--fs-detail)
--tag-trackingnormal
--tag-weightvar(--weight-semibold)

Parts and data attributes

ClassIs
.cap-badgeits own class
.cap-pill-dotits own class
.cap-statusthe root
.cap-status-glypha part
.cap-status-reasona part
AttributeValues
data-series2 3 4 5 6 7 8
data-tonecrit info muted nodata ok warn
data-variantaccent default destructive ghost link outline secondary tag
data-wrappresent or absent
StateRead from
:disabledthe platform
:focus-visiblethe platform
:hoverthe platform
[aria-disabled="true"]an attribute

Accessibility

KeyDoes
NoneA status, and a badge that is not a link or a button, is text. It takes no focus and has no keys.
TabReaches a link or button badge, in reading order
EnterFollows a link badge or presses a button badge; Space presses a button badge
  • The word is the accessible text; the glyph is hidden. Do not shorten the word to fit ("Crit").
  • Each tone's word reaches 4.5:1 on surface, raised, ground and sel, and on its own tint, in both themes (checked as painted).
  • Forced colors: the tint is removed, so a badge gains an outline (a link or button badge, the link color).
  • A count says what it counts: put the noun in a .cap-sr-only span after the number (3<span class="cap-sr-only"> waiting</span>).
  • A link or button badge's name is its word.