Patterns
Stat cards (premium KPIs)
icon · spark (area to the edge) · target (ring) · gradient (the lead number, one per page) · comparison (split bar).
Revenue today
$48,250
12.4%vs yesterday
Cars inside
312
6.2%vs last Thu
Failed payments
3
40.0%vs last week
Monthly target
৳9.6L
of ৳13.3L this month
72%
Occupancy, 14 days
82%
4.1%vs prior 14 days
Avg wait at the gate
38s
9.5%slower
How people paid
Cash at the gate
৳28,450
Digital
৳19,800
59%41%
stat-cards.tsx
"use client";
import { StatCard, StatGrid } from "@waveinno/ui";
import { Banknote, Car, Gauge, TrendingUp } from "lucide-react";
export default function StatCardsExample() {
return (
<div className="space-y-3">
<StatGrid>
<StatCard variant="gradient" label="Revenue today" value="48,250" currency delta={12.4} deltaLabel="vs yesterday" icon={<TrendingUp />} />
<StatCard variant="icon" label="Cars inside" value="312" icon={<Car />} delta={6.2} deltaLabel="vs last Thu" />
<StatCard variant="icon" label="Failed payments" value="3" icon={<Banknote />} tone="danger" delta={-40} invertDelta deltaLabel="vs last week" />
<StatCard variant="target" label="Monthly target" value="৳9.6L" target={{ percent: 72, label: "of ৳13.3L this month" }} />
</StatGrid>
<StatGrid className="xl:grid-cols-3">
<StatCard variant="spark" label="Occupancy, 14 days" value="82%" delta={4.1} deltaLabel="vs prior 14 days" spark={[61, 64, 63, 68, 70, 69, 72, 75, 74, 78, 77, 80, 81, 82]} icon={<Gauge />} />
<StatCard variant="spark" label="Avg wait at the gate" value="38s" delta={9.5} invertDelta deltaLabel="slower" spark={[30, 31, 29, 33, 32, 34, 35, 33, 36, 37, 36, 38, 39, 38]} tone="warning" />
<StatCard
variant="comparison"
label="How people paid"
value=""
parts={[
{ label: "Cash at the gate", value: 28450, display: "৳28,450" },
{ label: "Digital", value: 19800, display: "৳19,800" },
]}
/>
</StatGrid>
</div>
);
}Import#
Everything comes from the package root. The example above uses:
your-component.tsx
import { StatCard, StatGrid } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<StatCard>
src/components/patterns/stat-card.tsx| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | |
valuerequired | React.ReactNode | — | |
currency | boolean | — | Put the active currency symbol before the value. |
delta | number | — | |
invertDelta | boolean | — | |
deltaLabel | string | — | "vs last week" — what the delta compares with. |
hint | React.ReactNode | — | |
icon | React.ReactNode | — | |
tone | Tone | "info" | |
variant | "icon" | "spark" | "target" | "gradient" | "comparison" | "icon" | |
spark | number[] | — | spark: the series, oldest first. |
target | { percent: number; label: string } | — | target: progress 0–100 and the goal in words. |
parts | [{ label: string; value: number; display?: string }, { label: string; value: number; display?: string }] | — | comparison: two parts of the whole. |
className | string | — |
<StatGrid>
src/components/patterns/stat-card.tsx| Prop | Type | Default | Description |
|---|---|---|---|
childrenrequired | React.ReactNode | — | |
className | string | — |
Install#
If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.
$ npm install @waveinno/ui