Krizaka UI
Krizaka UI
ComponentsData display

Stat

A key figure: a label, a value in tabular digits, a hint and a trend said in words.

Web · ✓Mobile · ✗ to buildDesktop · ✓StableData display
Support level
Stable
Size
1.7 kB gzip, budget 1.5 kB
Who uses it
16 files of the live products and sites import it (Verikora: 1, Folioviv: 3, Sovkora: 4, krizaka.com: 1) Counted in the dated inventory of 2026-11-23.
import { Stat, StatGrid } from "@krizaka/ui/stat";

Web only — React, from @krizaka/ui/stat. Stable: its API only changes in a major version.

  • Mobile · ✗ to build. The phone dashboards (a creator's earnings, Sovkora usage) write a figure and its caption by hand. issue #275

Why it is here. Used by Sovkora, Verikora, Folioviv, krizaka.com.

When to use

  • On a dashboard: revenue, views, supporters.
  • In a row of a few figures that compare over the same period.

When not to use

  • For figures inside an item's card.Use instead: Card
  • For progress towards a goal.Use instead: Progress
  • For a status.Use instead: Badge

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { Stat, StatGrid } from "@krizaka/ui/stat";

Examples

Up

A rise, with its period.

Down

A fall, said in words next to the arrow.

Flat

No change.

Plain

Label and value only.

Revenue

€4,812

Row

A row of stats, as a dashboard shows them.

Strip

StatGrid variant="strip": two to four figures in one row, each with a sparkline (64 × 18) and its trend in words; a period slot takes the switch.

Grid

StatGrid: figures that wrap, hairlines between them, a meter under one (or a Sparkline of @krizaka/charts in chart).

Props

Stat

PropTypeDefaultDescription
labelrequiredReactNode—What the figure is ("Revenue"), above it.
valuerequiredReactNode—The figure, formatted by the app, in tabular digits.
chartReactNode—Under the figure: a Sparkline of @krizaka /charts (its own accessible summary), a Meter.
hintReactNode—A line under the value: the period, the comparison.
trendStatTrend—The direction of the change; its arrow is decorative.
trendLabelReactNode—The change, in words, as read and shown (e.g. "+12 % vs last week") — the arrow alone says nothing.

StatGrid

A row of key figures. The default grid wraps with the width (a dashboard's head, the stats are its children); variant="strip" is the discreet one: 2 to 4 figures in one row, as a dl, each with its sparkline and its trend in words.

PropTypeDefaultDescription
itemsrequiredreadonly StatStripItem[]—2 to 4 figures, in one row from 320 px.
dividedboolean—Hairlines between the stats (default) or space only.
minWidthnumber—The narrowest a stat may be before the row wraps, in rem. Default 11.
periodReactNode—The period switch (7 · 30 · 90 d), above the row.
variant"grid" | "strip"—grid (default): figures that wrap, hairlines between them. strip: the discreet row, 2 to 4 figures with their sparkline, as a description list.

Accessibility

  • The arrow is decorative; trendLabel is read and shown.
  • Colour is never the only signal of the trend.
  • The strip is a description list: each figure reads its label, its value, then its trend in words; a truncated label keeps its full text as its title.

Best practices

  • Format the value in the app (currency, compact numbers) with @krizaka/intl.
  • In a narrow column (a side panel, 26 rem) use StatGrid variant="strip", never four Stats stacked full width.
  • Put a Sparkline of @krizaka/charts (or a Meter) in chart: the figure first, its shape under it.
  • Say the change in trendLabel (“+12 %”) and the period in hint: the arrow alone says nothing.

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page