Skip to content

Stat Block

A prominent metric display combining a large value, label, and optional trend indicator. Use for dashboards and summary cards.

Preview

Total Users12,847 +12.5%
Revenue$48.2K +8.1%
Bounce Rate24.3% -3.2%

Inline (no card)

Active Sessions1,024

Anatomy

  • Label -- uppercase, muted descriptor (e.g. "Total Users").
  • Value -- large, bold metric (e.g. "12,847").
  • Trend (optional) -- directional indicator with percentage change.

Props

PropTypeDefaultDescription
valuestring | number--The metric value
labelstring--Descriptor text
trendnumber--Percentage change (positive = up)
cardbooleanfalseWrap in a card container

Code example

React

tsx
import { StatBlock } from '@thepace/lexicon/components';

<StatBlock value="12,847" label="Total Users" trend={12.5} card />
<StatBlock value="$48.2K" label="Revenue" trend={8.1} card />
<StatBlock value="24.3%" label="Bounce Rate" trend={-3.2} card />

Vanilla HTML

html
<div class="lex-stat lex-stat--card">
  <span class="lex-stat__label">Total Users</span>
  <span class="lex-stat__value">12,847</span>
  <span class="lex-stat__trend lex-stat__trend--up">
    <!-- up arrow icon -->
    +12.5%
  </span>
</div>

CSS class reference

ClassPurpose
.lex-statBase layout
.lex-stat--cardCard-wrapped variant
.lex-stat__valueLarge metric number
.lex-stat__labelMuted descriptor
.lex-stat__trendTrend container
.lex-stat__trend--upPositive trend (green)
.lex-stat__trend--downNegative trend (red)
.lex-stat-gridResponsive grid layout

Accessibility

  • Use aria-label or visible heading to give context to the stat group.
  • Trend direction should be conveyed in text, not just colour (the arrow helps).
  • Screen readers should read "Total Users: 12,847, up 12.5 percent".

Guidelines

Do

  • Use the card variant for dashboard KPI rows.
  • Align stat blocks in a grid for scannable comparison.
  • Include trend indicators when showing time-series data.

Don't

  • Don't show more than 4–5 stats in a single row.
  • Don't use for detailed data — use a Table instead.
  • Don't rely on colour alone for trend direction — always include an arrow or text.

Released under the MIT License. A product by the pace.