Stat
statA metric card with the value, a coloured change against the last period and a sparkline drawn as plain SVG on the server. Says which direction is good, so falling latency reads green.
import { Stat } from "@/components/forme/stat/stat";
export function StatDemo() {
return (
<div className="grid w-full gap-3 sm:grid-cols-3">
<Stat
label="Monthly recurring revenue"
value="$48,290"
delta={0.124}
deltaLabel="vs last month"
trend={[18, 22, 21, 27, 26, 31, 35, 34, 41, 46]}
/>
<Stat
label="Active workspaces"
value="2,814"
delta={0.038}
deltaLabel="this week"
trend={[40, 42, 41, 44, 43, 46, 45, 47]}
/>
<Stat
label="p95 latency"
value="182 ms"
delta={-0.21}
invertDelta
deltaLabel="since deploy"
trend={[260, 255, 240, 248, 220, 205, 196, 182]}
/>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
Stat
A metric: the number, its change, and the shape of how it got there.
| Prop | Type | Default | Description |
|---|---|---|---|
label* | ReactNode | — | |
value* | ReactNode | — | Already formatted. The stat does not guess your currency or your locale. |
delta | number | — | Change against the previous period, as a fraction: 0.124 is +12.4%. Its sign picks the colour, unless invertDelta says that down is good (churn, latency). |
invertDelta | boolean | false | |
deltaLabel | ReactNode | — | Short context for the delta, such as "vs last week". |
trend | readonly number[] | — | A series for the sparkline. Two points or more, any range. |
Also takes every prop of <div> attributes.
Sparkline
A line with a flat tint under it, in the current text colour.
| Prop | Type | Default | Description |
|---|---|---|---|
points* | readonly number[] | — | |
className | string | — |
Related


Line Chart
One or more series over an ordered axis on TanStack Charts, as smooth lines or as areas that fade to their baseline. A dashed cursor snaps to the nearest x from anywhere in the plot, the tooltip lists every series there, and areas can stack.
data display

Area Chart
A line or area chart in plain SVG with no chart library. A crosshair snaps to the nearest point and lists every series, arrow keys walk it, round tick values, a legend from two series up, and a hidden table so screen readers get the numbers.
data display

Avatar
A user image with a fallback that shows initials while the image loads, and when it never arrives at all. Built on the Base UI avatar primitive, so the image and the fallback swap without a flash of empty space.
data display