Components / data

Stat

One number and the word that says what it counts.

Rendered from the package · open on its own

Summary

One number and the word that says what it counts.

APG patternnone
Built onnative elements
Statusself-tested
Since0.7.0
<Stat label="Open items" value="42" />
<Stat label="Built this week" value="7" adornment={<Badge intent="positive" status>+3</Badge>} />
<Stat label="Parity rows" value="17 of 17" description="Every rebuilt route answers the old one" />

Several in a row are a StatGroup.

Anatomy

A <div data-se="stat"> holding label, value, an optional adornment beside the value, and an optional description below. The DOM order is label first, so a screen reader hears Open items, 42; the CSS draws the value first, because that is what the eye wants.

PartElementRequired
adornment<span>no
description<span>no
label<span>yes
value<span>yes
<div data-se="stat">
  <span data-part="label" data-se-text="caption">Built this week</span>
  <span data-part="value" data-se-text="subheading">7</span>
  <span data-part="adornment"><span data-se="badge" data-intent="positive">…</span></span>
  <span data-part="description">Against 5 last week</span>
</div>

adornment is Field's word for the same thing: a slot that may hold a glyph, a badge or a short text, named for none of them. The roles are part of the anatomy: caption on the label, subheading on the value — a consumer writing the markup by hand writes them too.

Properties

PropertyValuesDefaultWhat it does
labelstringrequiredWhat the number counts. Drawn small above the value, and read first.
valueReact.ReactNoderequiredThe number, already formatted. The component formats nothing — a locale, a unit and a rounding rule are the caller's, and a formatter here would be a second place they could disagree.
adornmentReact.ReactNodenoneWhat sits beside the value: a Badge carrying the change, or a short text. It is never the value's meaning on its own — a reader who cannot see it must still get the number.
descriptionstringnoneOne line under the number saying what it is measured against, or over what period. Omit it when the label already says.

States

_None. Rest is the only condition it has._

Behavior

None. A stat that changes re-renders with its new value, and nothing counts up or flashes — a number that moves is a number the reader has to wait for.

Accessibility

The label and the value are one reading, in that order. A number read before its label is a number without meaning until the next word arrives.

Not a live region. A dashboard of stats refreshing on a timer would otherwise announce itself every tick. If one stat's change must be heard, the caller says so with an Alert.

No heading. A stat is not a section; its label is not a heading level. Pages that list stats under a heading write that heading themselves.

Keyboard

None of its own. It is not focusable and takes no keys.

Roles, states and properties

_None written. The elements carry their own._

Focus

Never takes focus.

Screen reader

Not recorded as verified. Stage 4 of the readiness ladder — driving each component with VoiceOver and NVDA — is unstarted across the package, and no component should claim otherwise until docs/journal/ records the session that did it.

Contrast and target size

npm run check:contrast audits every color pair this component uses across all four skins, light and dark, and fails the build on a shortfall. Two waivers are on the record in docs/audit/DEFERRED.md.

It sets no target size of its own; anything interactive inside it brings its own.

Tested

  • test/apg/batch-c.test.jsx
  • test/apg/batch-e.test.jsx
  • test/apg/calendar.test.jsx
  • test/apg/client-boundary.test.jsx
  • test/apg/collapsible.test.jsx
  • test/apg/harness.mjs
  • test/apg/listbox-ids.test.jsx
  • test/apg/partials-sweep.test.jsx
  • test/apg/signals.test.jsx
  • test/apg/stat-prose.test.jsx
  • test/browser/layers.spec.mjs
  • test/browser/page-shell.spec.mjs
  • test/browser/site.spec.mjs
  • test/browser/stages.spec.mjs
  • test/browser/stat-group-tiles.spec.mjs
  • test/browser/stat-prose.spec.mjs
  • test/browser/surfaces.spec.mjs

Known gaps

_No upstream requirement is recorded as not applicable._

Appearance

The label is drawn above the value, small, muted and at the label weight, in sentence case. The value takes the subheading role's step — xl — through data-se-text="subheading", at the bold weight, in the skin's own face with tabular figures. Not the code face: it ships one weight, so a bold number in it is one the browser fakes. The label takes the eyebrow role above it; the description is small, muted text below. The order on screen is value, then label, then description — a grid with named areas, so the DOM order can stay label-first.

TokenUsed for
--se-font-sansfont-family
--se-leading-bodyline-height
--se-space-1row-gap
--se-space-2column-gap
--se-textcolor
--se-text-mutedcolor
--se-text-smfont-size
--se-weight-boldfont-weight
--se-weight-mediumfont-weight

No border, no surface. A stat on its own sits in the flow; the frame is StatGroup's.

Motion

None.

Content

The label is the thing counted, two or three words. Open items, Built this week, Days since close. Not Number of open items.

The value is formatted for reading, not for machines. 1,204, 17 of 17, 3.2 GB. The unit stays with the number; it is not a second part.

The description answers "against what". Against 5 last week, Of 255 parity rows. If the label already answers it, leave it out.

Usage

One stat per number. A stat that holds two numbers is two stats, in a group.

The adornment is the change, not the meaning. A positive badge reading +3 beside 7 says the number went up. It does not say whether up is good; the label does.

When not to use it. For a number inside a range — storage used, sections filled — use Meter, which draws the range. For a label and a value in a list, Rows with its facts form. For a number in running text, text.

Notes

Four apps built this strip by hand — the builder's .cc-metric and .hub-stat, hosting-event's .stats, the studio's .cc-card, and the old Command Center's Metric thirteen times — each with its own size for the value and its own order for the label. The review supported a component on 15 Oct 2026.

A headline number is in the skin's own face, at its real bold. The code face stays for small figures beside a control — Meter and Slider values — where it is set at its one weight.

DOM order label-first, visual order value-first. Chosen for the screen reader; the cost is a grid instead of a column, which is a CSS decision and not a contract one.

The label reads as words and sits above the number (14 Nov 2026). The label took the eyebrow role, tracked capitals, and sat under the value; the value took the heading step, the size of a page's heading. Two of the owner's own products draw a stat the other way: the word first, in sentence case, and the number one step smaller. The drawn order is now the order the markup is in, so nothing is reordered for the eye.