Stat
A big number followed by its word, no box, or a tile with its label, change and trend. StatGroup lines numbers up in a row or tiles in a grid.
<StatGroup variant="row">
<Stat value="12,480" unit="requests" />
<Stat value="$184.20" unit="total spend" delta={{ label: "+12%", tone: "neutral" }} />
<Stat value="1.2 s" unit="median latency" />
</StatGroup>import { Stat, StatGroup } from "@logicplanes/kaeso-ui";Props
change{ value: number; better?: "none" | "up" | "down"; }The change against the previous period, as a fraction (0.12 is +12%).
bettersays which direction is good: errors are better down, andnonekeeps a number such as cost neutral. It is written as text byDelta: green or red, and "better" or "worse" for screen readers.delta{ label: string; tone?: "neutral" | "success" | "danger"; }A delta badge: "+12%".
detailReactNodeA quiet line under the number: "vs. the previous 30 days", "0.4% of requests".
labelReactNodeWhat the number counts: "Requests", "Cost". A tile sets it at its foot.
loadingbooleanWhile the numbers load: the value, the change and the trend show their shape at the tile's final height.
size"md" | "sm" = mdThe size of the number.
trendnumber[]One value per day (or step), drawn as a sparkline across the tile. A tile without it has no room for one; pass
[]while a trend loads to keep it.trendColorstringThe trend's color; the first series color by default.
unitReactNodeThe word after it, on the same baseline: "total spend", "sessions".
valueReactNodeThe number, already formatted: "$12.40", "1.2M".
variant"plain" | "tile" = gridA plain number with its unit and delta, or a tile in a
StatGroupwith its label, change, detail and trend.