Stat
A number and what it is: a label, its period, the value with its change, and a sparkline whose reading writes the value.
import { Stat } from "@arcadia/ui/charts"RequestsToday
9,100up 12% from Sep 8
LatencyToday
111msdown 14% from Sep 8
ErrorsToday
39up 22% from Sep 8
SessionsToday
1,388up 12% from Sep 8
TSX
Anatomy
- Label
- What it counts, with its unit where the value has none: Caption in
--text-2. One too long for its tile fades at its end. - Period
- What the value covers, at the end of the label's line in Caption and
--text-3, tabular. - Value
- The largest thing in the tile, in full: Title 3, 20/23 at 600, tabular, in
--text-1. It never wraps and is never cut. - Delta
- A
Deltain Caption on its own line under the value, starting where the value starts. It never sits beside the value, however much room there is, so tiles in a row keep the same lines. - Sparkline
- Optional, 32px tall across the tile at its foot, 12px under the change, or under the value in a tile with no change. Its reading writes the value and the period.
- Frame
- None. Tiles in a row part by space or hairlines; one that stands alone may sit in a
Card.
Examples
Reading
Stat
labelrequired- string
- What it counts: "Requests", "Spend in USD".
period- string
- What the value covers: "Today".
valuerequired- string
- In full: "12,480".
delta- ReactNode
- A
Delta. rootStyle- RootStyle
- A component's typed override prop:
Layoutand 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). children- ReactNode
- A
Sparkline, whose reading writes the value and the period.
Rest props go to HTMLAttributes<HTMLDivElement>.