Skip to main content

KPI tile

One number with a label, a context sentence and an optional sparkline.

<mm-kpi-row label="Last 24 hours">
<mm-kpi-tile label="Queries in last 24h" value="12480" delta="1204" context="on yesterday" spark="[212,168,141,126,133]"></mm-kpi-tile>
<mm-kpi-tile label="Active agents" value="14" context="across 6 domains"></mm-kpi-tile>
<mm-kpi-tile label="Refused" value="37" delta="12" context="since yesterday" trend="bad"></mm-kpi-tile>
<mm-kpi-tile label="Catalogued assets" value="24059" context="from 9 sources"></mm-kpi-tile>
</mm-kpi-row>

Guidance​

KPI tiles show one number with its context, on Insights and Home: a 12px sentence-case label, the value in display-kpi (Geist 600, tabular), and one context caption line: the delta and the context together ("+1,244 on the day before · from 5 sources"), never two lines. A delta is written with its sign and coloured only when it is good or bad news (trend="good" in moss, trend="bad" in crimson); it never gets an arrow. An optional 64×16 sparkline sits beside the value.

Put tiles in an mm-kpi-row, which lays them in one panel separated by rules rather than as separate cards.

Properties​

PropertyAttributeTypeDefaultDescription
labellabelstring''Sentence-case label, e.g. "Queries in last 24h".
valuevaluestring | number''The number. Numbers are grouped ("12,480"), or compact with compact ("1.28M"); strings show as given ("87%").
unitunitstring''Unit after the value, e.g. "ms".
compactcompactbooleanfalseFormats numeric values compactly ("1.28M").
deltadeltanumber | undefinedSigned change, printed with its sign ("+214", "−12").
deltaUnitdelta-unitstring''Unit after the delta, e.g. "points".
contextcontextstring''The rest of the context sentence, e.g. "this week" or "from 9 sources".
trendtrend'good' | 'bad' | 'neutral''neutral'good or bad colours the delta (moss or crimson); neutral (default) leaves it uncoloured.
sparksparknumber[][]Values for a 64×16 sparkline beside the number, oldest first.
loadingloadingbooleanfalseShows a skeleton in place of the value.
errorerrorstring''An error sentence shown in place of the context.

Slots​

SlotDescription
contextA richer context sentence, replacing context.

CSS parts​

PartDescription
labelThe label.
valueThe number.
contextThe context sentence.
deltaThe signed delta.

Examples​

Every state of mm-kpi-tile in Storybook, with keyboard and screen reader tests.