Search...

Search documentation...

Stat Card

Stat Card

The KPI tile pattern — a boxed icon + label, a large bold number, a colored up/down trend line below. changePct drives the trend color/icon automatically: green+up for positive, red+down for negative.

import { StatCard } from "@pompeitech/vesuvius-ui";

Default

Total Revenue
$45,231.89
+12.4%vs last month
Avg. Order Value
$68.20
-1.8%vs last month

With a trend visual

trend accepts any ReactNode — typically a Sparkline — so StatCard doesn't have to depend on the charts module itself.

Average Sales
837
+1.3%vs last month

API

StatCard

PropTypeDefaultDescription
labelstring
valueReactNodeThe headline figure.
iconLucideIconOptional boxed icon next to the label.
changePctnumbere.g. 12.4 or -3.2 — drives the trend badge's color and up/down arrow automatically.
changeLabelstring"vs last month"Text after the percentage.
trendReactNodeAn inline visual, e.g. a Sparkline.

Plus every native <div> prop on the root.