Skip to content
ArcadiaDesign
up 12% from last week
Up
down 3.2% from yesterday
Down
no change from last month
No change
A change written once: its sign and the kit's arrow before the number, and what it is measured against after it.

TSX

Delta is the one way a change is written, in a Stat, a table cell or a line of text, so none is built by hand. value is the change as a share of what it is measured against (0.12 is +12%), written by fmtDelta: always signed, with the true minus, and 0% with no arrow when nothing changed. format writes other units.

baseline says in words what the change is measured against, a period of the same length before it: "from last week", "from yesterday". In a table it goes once in the column's head instead.

A change is ink, because up is not always good: a rising error rate or bill is not good news. Only where one direction is plainly good does polarity name it, and the arrow and the number then take --text-success that way and --text-danger the other. The baseline stays --text-3 and no change stays ink.

Examples

Polarity

Ink with no polarity. With one, the good way is the success hue and the bad way the danger hue, on the arrow and the number only.

Polarity
Up
Down
No change
None
up 12%
down 3.2%
no change
up
up 12%
down 3.2%
no change
down
up 12%
down 3.2%
no change

Other units

format writes a change in its own unit: fmtCount for a count, fmtMs for a duration, formatBytes for a size.

up 682 from yesterday
A count
down 1m 12s from last week
A duration, shorter is better
up 1.5 GB from last month
A size

In a table

A column of changes, end-aligned and tabular, the baseline said once in its head. Fewer errors is better, so each takes polarity="down".

Service
Errors
From last week
Search
1,284
up 6.7%
Checkout
962
down 5.2%
Accounts
731
up 6.3%
Notifications
605
down 5.5%
Billing
488
up 4.7%
Exports
342
down 7.8%
Uploads
219
no change
Webhooks
96
down 7.7%

The arrow and the sign are drawn for the eye. A screen reader hears the direction in words, then the baseline: "up 12% from last week", "down 3.2% from yesterday", "no change from last month". Copied, the change reads as it is drawn, "+12% from last week".

Colour is never the only key. A judged change keeps its arrow, its sign and its words, so it reads the same in a grey screenshot; both hues hold 4.5:1 on every surface a chart sits on, in both themes.

Delta

valuerequired
number
A share of what it is measured against (0.12 is +12%), or with format an amount.
baseline
string
What it is measured against, in words: "from last week".
polarity
"up" | "down"
The direction that is good, in the success hue; the other takes the danger hue. Unset, both are ink.
format
(n: number) => string
fmtCount for a count, fmtMs for a duration.
rootStyle
RootStyle
A component's typed override prop: Layout and its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).

Rest props go to HTMLAttributes<HTMLSpanElement>.