StatGroup: the key figures at the top of an overview
StatGroup sets an overview's key figures in one row: the first in display size, the others a step quieter beside it, each with its change against the previous period and a small trend line. It lays itself out by its own width rather than the window's, so the same group reads four across on a wide screen and stacks on a phone.
By Bohuslav PoláčekChecked
What it is for, and what the preview shows
The few numbers someone opens an overview to see. The preview is the top of Ridgeway Freight's reports for the last seven days as the demo shows them on Wednesday 2 December 2026, rebuilt from the kit with the demo's figures. It opens with the headline every overview has, a sentence with the numbers in it, then four figures: 648 shipments in display size, 94.0% delivered on time against a goal of 95%, 114,347 km driven and a fuel use of 28.5 l/100 km. Each carries its change against the previous seven days and a sparkline.
The colour of a change says whether it is good news, not which way it went. Fewer shipments and fewer kilometres are red, because more of both is what the business wants; lower fuel use is green; on-time delivery has not moved and says "no change" in grey. On a phone the display figure takes a row of its own and the other three wrap under it.
The rules, and where they live
- The manifest: use it for a row of key figures on an overview, a
Statwith aSparklineeach; not for a chart (ColumnChartin aChartCard). It replaces "a grid of hand-built KPI cards". - AGENTS.md, Look and feel: an overview opens with its
headline, a sentence with numbers drawn asLead, and it is required; figures areStatGroup,heroby default, with one display figure a screen at 40px at most. - docs/principles.md, Charts: a figure's change is green or red by whether it is good news (
DeltagoodWhen), and "no change" when it rounds to zero. - docs/patterns.md, Data: figures with a trend, the first one in display size, the others a step quieter, no frame; a change that says whether it is good news.
- docs/decisions/0009-orientation.md: the hero became the default, the boxed
framedvariant is deprecated, and above a list on a phone the group turns into a compact band so the list starts in the upper half of the screen. - scripts/check-markup.mjs:
framed-statsfails<StatGroup variant="framed">in an app.
What AI coding tools write instead
A grid of hand-built KPI cards, as the manifest's replaces names it. What goes wrong:
- Four boxes with shadows, all the same size, so nothing says which number matters. The kit sets one figure in display size and the others beside it on the page, with no boxes.
- A rise is green and a fall is red, whatever the figure. Fuel use falling is good news:
goodWhenmakes the colour follow the meaning, and a change that rounds to zero says "no change" instead of a red "−0.0%". - The cards break by the window's width, so a panel opened beside the page squeezes four cards into slivers. The kit's group follows its own width: four across needs 48rem, about 192px a figure.
- The figures carry no trend, so a bad day cannot be told from a slide all week. The kit's
Stattakes aSparklinebeside or under its value, and leaves it out on a phone. - Nothing above the cards says what they add up to. The kit's overview opens with the
Leadsentence first: 648 shipments in seven days, below the goal.
How to use it
StatGroupholdsStatchildren;variantisheroby default, oropenfor figures with air between them and no frame.Stat:label,value,hint(usually aDelta) andchart(aSparkline);heromakes another figure the display one.Delta:value(0.034 is +3.4%),kind(percent,pointsfor a rate,absolutewith aunit),goodWhen(upordown) andsuffix, what it is measured against.Sparkline: the period'svalues, drawn to their own range.Leadabove the group carries the overview's headline.
Its entry in the manifest
| Manifest field | StatGroup |
|---|---|
| What it is | Frame for Stats. Cells draw a hairline on their top and left edge; the inner grid is shifted up and left by 1px and the frame clips it, so only the lines between cells remain, in any column count. Columns follow the frame's own width (container query), not the window: a StatGroup in a side column or a half-width story stays two per row. Four across needs 48rem (192px a cell), the width "4 573 473 Kč" at 24px needs. Hero is the default since decision 0009 (3 Nov 2026): the first figure in display size, no frame. It takes its own row below 48rem (a 30px figure does not fit half of a 390px phone), and with five or more figures it keeps that row at every width while the rest wrap two, three or four across (a 1.4fr column beside four was 110px). One figure is one column. In an index (above a list, useScreenInset) the group is a compact band where it is narrower than 36rem (a phone, decision 0009's phone rule, 4 Nov 2026): every figure two across at 20px, the hints left out, so the list starts in the upper half of a 390 × 844 screen. Stonebridge Zakázky put four figures, 270px, above its list; the band is 108px. One line for the labels, one baseline for the values (Bob, 1 Dec 2026: Ridgeway's Reports and Martin's media kit had their labels at 257, 267 and 281px, because the cells sat on their bottom edge and a taller hero figure, a hint or a sparkline that wrapped lifted their labels). Each Stat is a subgrid of the group's rows, label, value and hint, so labels share a line, values share a baseline whatever their size, and hints share a line under the tallest value. The display figure is 40px at most (32px on a phone) and there is one a screen: on a Screen a second hero group draws its figures at the regular size (useHeroClaim). |
| Use it for | A row of key figures on an overview (Stat, with a Sparkline). |
| Not for | For a chart (ColumnChart in a ChartCard) |
| It replaces | A grid of hand-built KPI cards |
| Screen types | Overview; Record |
| Import | import { StatGroup, Stat, Sparkline } from "@meadowstack-studio/kit"; |
Where it runs in the example apps
| Example app | Modules that render it |
|---|---|
| An app for a packaging and print company | Jobs, Print file editor, Cutting dies, Colour |
| An app for a studio or agency | Tasks, Finance |
| An app for a haulage company | Freight, Costs, Reports |
| An app for a roastery with an online shop | Roasting, Green coffee, Shop, Wholesale, Scenarios |
| An app for a sports club | Front desk, Courts, Club, Coaching, Rentals |
| An app for a construction company | Sites, Machines, Site diary, Drawings, Budget |
| An app for an accounting office | Bookkeeping, Official mail, Invoicing |
| An app for restaurants and venues | Shifts, Kitchen, Food safety |
| An app for one person | Content, Money, Training |
How the demo calls it
<StatGroup key={index}>
{widget.items.map((kpi) => {
const base = formatter(kpi.format);
const format = (value: number) => (kpi.unit ? `${base(value)} ${kpi.unit}` : base(value));
return (
<Stat
key={kpi.label}
label={<KpiLabel kpi={kpi} />}
value={
<AnimatedNumber
value={
kpi.format === "percent"
? Math.round(kpi.value * 1000) / 1000
: kpi.format === "decimal"
? Math.round(kpi.value * 10) / 10
: Math.round(kpi.value)
}
format={format}
/>
}
hint={<KpiHint kpi={kpi} />}
chart={kpi.trend ? <Sparkline values={kpi.trend} /> : undefined}
/>
);
})}
</StatGroup>Questions
Which figure is shown large?
The first Stat in a hero group, unless another one says hero. A screen has one display figure, at most 40px, and the rest sit beside it a step quieter.
How does the change know whether it is good news?
Delta takes goodWhen, up or down. Shipments falling is red, fuel use falling is green, and a change that rounds to zero at one decimal is a grey no change.
What happens on a phone?
The group follows its own width. Below 48rem the display figure takes its own row, because a 30px figure does not fit half of a 390px screen, and the others wrap under it. Above a list on a phone the group becomes a compact band of two figures a row.
Can the figures sit in boxes?
No. The boxed framed variant is deprecated and the markup check fails it in an app. Use the hero, or open for numbers that sit on the page with air between them.
Related
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app