Calm motion: animations on this site only fade, with no movement
Stat
KPI tile: value, change, and trend
A number that people check at a glance: revenue, error rate, signups. Show the value large and thin, the change under it, and an optional trend line. For a chart that the reader studies, use Chart. For a trend in a table row, use Sparkline.
Basic
Revenue
$12,400
Up 12.5%
Error rate
2.1%
Down 0.4%
Signups
318
Down 8%
Since last week
Uptime
99.98%
No change 0%
deltais a number with a sign or a string. A number shows an arrow, the size, anddeltaUnit(default%). A string shows as you wrote it.goodWhen="down"marks a fall as good news, for example an error rate. Only bad news turns red. Good news stays ink, because color means chosen.- The direction is also text. A screen reader hears "Up 12.5%", "Down 0.4%", or "No change". Replace the words with
labels. datadraws a Sparkline under the value. Name it withdataLabel.- The
#hintslot adds a line of small text. The default slot replaces the value, for example with a CountUp.
Usage
ts
import { BlessStat } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
label* | string | — | |
value* | string | number | — | |
delta | string | number | — | change since the last period. A number shows its sign and a percent sign. |
goodWhen | "up" | "down" | "up" | which direction is good news: `up` (default) or `down` (for example, error rate) |
deltaUnit | string | "%" | unit text for the delta, read after the number (default `%`) |
data | number[] | — | trend line under the value |
dataLabel | string | — | names the trend line for screen readers |
labels | Partial<{ up: string; down: string; flat: string; }> | — | words for the direction, read by screen readers |
Slots
| Name | Scope | Description |
|---|---|---|
default | — | |
hint | — |