Skip to content

Stat Strip

StatStrip is the row of figures at the top of a list page: open orders, past due, open value. A screen hands it the numbers; it owns the layout. For a dashboard KPI with a change indicator, use StatCard instead.

Live demo

18Open orders
7Sent, not received
3Past due
$128,400Open value

Joined variant

variant="joined" is one bordered strip with dividers between the stats, no icon chips, and a column per stat. It is the Hub My Functions summary. It collapses to two columns when the strip itself is narrower than 560px, whatever the viewport.

9Functions this phase
4Primary
5Secondary
6.5 hDaily effort
7/12Content ready

Clickable tiles

Give a stat onSelect and its tile becomes a button; one click filters the list to that figure. Pass selectedKey to show which tile is applied. The page owns the toggle: clicking the selected tile calls onSelect(key) again, and the page clears its filter. The strip keeps no state of its own. A tile showing 0 stays clickable (the page shows its own empty state). disabled mutes a tile; loading makes every tile display-only with a placeholder figure.

Filter: late. Loading:

–Open
–Late
–Total

Behavior

  • One tile per stat: the figure, then its label, with an optional icon chip at the start.
  • Three to five stats, always. A workflow page’s strip holds no fewer than 3 and no more than 5 (STAT_STRIP_MIN, STAT_STRIP_MAX). assertStatCount throws outside production when the count is outside that range; production warns once and renders anyway. Columns follow the count on a desktop, two on a tablet, one column on a phone.
  • A clickable tile is a native button with aria-pressed, Enter and Space to activate, the design system’s focus ring, and a 44px minimum height. The selected tile has a 2px primary border and a tinted ground, with no layout shift.
  • The chip’s colour is the stat’s tone: navy (the default), info, warning or danger. The colours come from the design tokens in light and dark.
  • The strip is a labelled region, “Summary” unless the screen names it.

Usage

import { StatStrip } from "@beacon/design-system";
<StatStrip
label="Purchase order summary"
stats={[
{ key: "open", label: "Open orders", value: 18 },
{ key: "late", label: "Past due", value: 3, tone: "danger", icon: <RoleIcon role="status.late" /> },
]}
/>

Props

PropTypeDescription
statsStatStripItem[]key, label, value, and optionally tone, icon, onSelect, ariaLabel, disabled.
variant"tiles" | "joined"A card per stat with an icon chip (default), or one divided strip.
labelstringThe region’s accessible name. Default “Summary”.
selectedKeystring | nullThe tile applied as the page filter. Controlled by the page.
loadingbooleanEvery tile display-only with a placeholder figure.

Each StatStripItem also takes onSelect(key) (makes it a button), ariaLabel (default “value label” when both are plain text) and disabled.