-
Notifications
You must be signed in to change notification settings - Fork 0
components stat
GitHub Actions edited this page Sep 18, 2026
·
2 revisions
Import: import { Stat } from "@tundralibs/ui/stat"
Rendered in every variant on the catalogue (deno task build:demos, then demo/index.html). Guides: Getting started · rAPId integration · Theming.
Stat(props: StatProps): HtmlA KPI tile: icon chip, label, value, trend.
"neutral""primary""success""warning""danger""info"
| Prop | Type | Required | Description |
|---|---|---|---|
label |
`string | Html` | yes |
value |
`string | Html` | yes |
icon |
Html |
||
tone |
StatTone |
||
trend |
{ label: string; up: boolean } |
e.g. { label: "+12.4%", up: true } — rendered as a status badge. |
|
attrs |
Attrs |
Each example as the rAPId call and the HTML it renders — the markup a plain page writes by hand. Icons are inline SVG in the real output; they are shortened to <svg …>…</svg> here.
Stat({ label: "Revenue (30d)", value: "$48,200", trend: { label: "+12.4%", up: true } })<div class="stat">
<span class="stat__label">Revenue (30d)</span>
<span class="stat__value">$48,200</span>
<span class="stat__trend">
<span class="badge badge--success">+12.4%</span>
</span>
</div>Classes defined by components/stat/stat.css — structural, token-driven; override from an unlayered stylesheet (see Theming):
.stat, .stat--danger, .stat--info, .stat--primary, .stat--success, .stat--warning, .stat__icon, .stat__label, .stat__trend, .stat__value
Guides
Reference