Skip to content
Fleetline

Stat

Usage

Use a stat to show one key number on a dashboard: fleet uptime, overdue services, mean time to repair. Group three to five in a .stat-group. Use a chart when the shape over time matters more than the current value, and a table for many numbers.

Content: label says what and over which period ("Fleet uptime, last 7 days"). Deltas are full phrases with the comparison: "Up 1.2 points vs last week". Round to what people act on (97.4%, not 97.4183%).

Anatomy

  1. Container — .stat
  2. Label — dt.stat__label
  3. Value — dd.stat__value with tabular numerals, plus .stat__unit
  4. Delta (optional) — .stat__delta--good|bad|flat: arrow icon + text
  5. Note (optional) — .stat__note
  6. Sparkline (optional) — svg.stat__sparkline, aria-hidden

Examples

States marked hover and focus-visible are frozen with .is-hover and .is-focus-visible. Those classes share their rule with the real pseudo-class; never use them in product code.

Stat

Delta tone follows meaning, not direction: fewer overdue services is good (green, arrow down).

Vehicles in service
118of 126
Fleet uptime, last 7 days
97.4%

Up 1.2 points vs last week

Overdue services
7

Down 3 vs last week

Oldest: Pickup PU-012, 6 days

Mean time to repair
4.6h

Up 0.8 h over 30 days

Parts spend, this month

Loading parts spend
<div class="stat">
  <dl class="stat__body">
    <dt class="stat__label">Fleet uptime, last 7 days</dt>
    <dd class="stat__value">97.4<span class="stat__unit">%</span></dd>
  </dl>
  <p class="stat__delta stat__delta--good"><svg class="" aria-hidden="true" focusable="false"><use href="#icon-arrow-up"></use></svg>Up 1.2 points vs last week</p>
</div>

<div class="stat" aria-busy="true">
  <p class="stat__label">Parts spend, this month</p>
  <span class="stat__skeleton stat__skeleton--value" aria-hidden="true"></span>
  <span class="stat__skeleton stat__skeleton--delta" aria-hidden="true"></span>
  <span class="sr-only">Loading parts spend</span>
</div>

API

HookValuesPurpose
.statblock classTile
.stat__body | __label | __value | __unit | __notepart classesContent (use dl/dt/dd for label and value)
.stat__delta--good | --bad | --flatpart modifierDelta tone by meaning → feedback success/danger/neutral
.stat__sparklinepart classDecorative trend line (--dataviz-categorical-1)
aria-busy="true"attributeLoading; use .stat__skeleton (--value | --delta) and an .sr-only message
.stat-groupcompanion blockAuto-fit grid of stats

Do and don't

"Down 3 vs last week" in green for overdue services

Do color by meaning and say the direction in words.

Red for every downward arrow

Don’t tie color to arrow direction.

"Fleet uptime, last 7 days"

Do state the period in the label.

A sparkline with no text trend

Don’t make the sparkline the only place the trend appears.

Accessibility

Stats are static; no keyboard behavior.

Tokens

Custom propertyPurpose
--color-elevation-surface-raised, --card-radiusTile surface and shape
--font-size-3xl, --font-tracking-tightValue
--color-feedback-success-* | -danger-*Good / bad delta
--dataviz-categorical-1Sparkline stroke
--color-bg-muted, --motion-duration-slowerSkeleton fill and pulse
--icon-size-smDelta arrow