Statistic

KPI card — label + big number + optional prefix / suffix + delta.

Basic

<wr-statistic label="Active users" [value]="12345" />
<wr-statistic label="Revenue" [value]="9512" prefix="$" [delta]="12.4" />
Active users
12,345
Revenue
$9,512
+12.4%
Churn
2%
-0.4%

Dashboard grid

<wr-statistic-group> lays cards out in a grid that reflows on its OWN width — a container query, not a viewport breakpoint — so it adapts inside any column, card, or split pane. Drag the handle at the bottom-right to watch the columns step down. min sets the narrowest column; columns caps how many sit in a row.

<wr-statistic-group [columns]="4" min="11rem">
  <wr-statistic label="Active users" [value]="12345" />
  <wr-statistic label="Revenue" [value]="9512" prefix="$" [delta]="12.4" />
  <wr-statistic label="Churn" [value]="1.8" suffix="%" [delta]="-0.4" />
  <wr-statistic label="Sessions" [value]="48210" />
</wr-statistic-group>
Active users
12,345
Revenue
$9,512
+12.4%
Churn
2%
-0.4%
Sessions
48,210

Count up

A live dashboard — values randomize on a timer (~2s) and tween from their previous value to the new one (~700ms ease-out). The delta swings positive/negative so the up/down indicator flips green/red. Honours precision, opts out via [animate]='false', and respects prefers-reduced-motion.

<wr-statistic label="Revenue" prefix="$" [value]="revenue()" [precision]="2" [delta]="delta()" />
<wr-statistic label="Sessions" [value]="sessions()" />

// numeric values count up from their previous value on every change.
protected readonly revenue = signal(9512.4);
protected readonly sessions = signal(48210);
protected readonly delta = signal(12.4);

constructor() {
  // Live dashboard — randomize on a timer so the values keep counting.
  const id = setInterval(() => {
    this.revenue.set(Math.round(Math.random() * 5_000_00) / 100);
    this.sessions.set(Math.floor(Math.random() * 90_000));
    this.delta.set(Math.round((Math.random() * 40 - 20) * 10) / 10);
  }, 2000);
  inject(DestroyRef).onDestroy(() => clearInterval(id));
}
Revenue
$9,512.40
+12.4%
Sessions
48,210
Sessions (no animation)
48,210

Countdown

<wr-statistic-countdown> ticks down to a target date. Format tokens: D/H/m/s (doubled for zero-padded width 2), plus SSS for milliseconds.

<wr-statistic-countdown
  label="Launch in"
  [target]="launchDate"
  format="D days HH:mm:ss"
  (countdownEnd)="onLive()"
/>

protected readonly launchDate = new Date(Date.now() + 1000 * 60 * 60 * 36);
Launch in
1 days 11:59:59
Soon (fires in ~30s)
00:29

API

NameDescriptionTypeDefault
<wr-statistic>KPI card.component
labelLabel above the value.string''
valueMain number or string shown.number | string | nullnull
prefixLeading glyph or symbol.string''
suffixTrailing glyph or unit.string''
precisionFixed decimals for numeric values.number0
animateCount up to a new numeric value (off for strings / reduced motion).booleantrue
durationCount-up duration in ms.number700
deltaChange vs previous period.number | nullnull
deltaSuffixUnit appended to the delta. Falls back to the statistic.deltaSuffix catalog key.string | nullnull
<wr-statistic-group>Responsive dashboard grid — reflows on its own width, not the viewport.component
minMinimum column width before the grid reflows to fewer columns.string'12rem'
columnsCap on columns for a wide container (0 = uncapped).number0
<wr-statistic-countdown>Live countdown variant.component
targetrequiredDate or timestamp to count down to.Date | string | number
labelLabel above the value.string''
formatFormat string for the remaining time.string'HH:mm:ss'
endTextText shown once it reaches zero.string | nullnull
tickMsTick interval in milliseconds.number1000
(countdownEnd)Emits once when the target time is reached.void

CSS variables

Custom properties ngwr/statistic publishes. Each default below is declared on the component's own selector, so a :root override is shadowed by it — set them on that selector, on a wrapper you scope yourself, or inline on the element. Unlike the BEM class names, these are the supported way to restyle the component.

VariableDefaultDeclared on
--wr-statistic-group-gap1.5rem.wr-statistic-group +1 variant override