Skip to content
PreviewEach sparkline beside its number: a line for a measure, an area for an amount, bars for a count of its own each day.
111ms
line: response time
9,100
area: requests
9
bars: deploys

Sparkline

labelrequired
string
What it counts ("Requests per day"): its name starts with it.
xrequired
readonly (string | number | Date)[]
The rows, oldest first: days as yyyy-mm-dd, timestamps, or names.
valuesrequired
readonly (number | null | undefined)[]
A value per row; null is a gap.
kind
"line" | "area" | "bars"
Default: "line"
size
"sm" | "md" | "lg"
16, 24 or 32px; lg in a Stat.
color
string
Default: chartColor(1)
The paint of the slot its entity owns.
curve
"monotone" | "straight" | "step"
Default: "monotone"
unit
string
A symbol every number carries (ms, %).
format
(value: number) => string
How a read value is written: fmtCount, fmtPercent.
onRead
(point: SparkPoint | null) => void
Turns the reading on: called with each point read, then null when the reading ends.
rootStyle
RootStyle<SparklineKnobs>

Rest props go to HTMLAttributes<HTMLDivElement>.

State machine

PreviewRead response time over four weeks.