KPI Cards

Compact cards for a single headline figure and its context. Every variant below is lifted from a page this project ships, so the markup you copy is the markup that renders. Each snippet is the card alone — drop it into any grid. The last section documents the grid.

Basic

Used in sales-dashboard.html

Label, value and a supporting line. The smallest useful KPI card.

Total Revenue

$48,290

Across 1,284 orders

Icon and delta

Used in hr-dashboard.html

A tinted icon identifies the metric and a signed delta states its direction. The arrow and the colour agree, so the change reads without relying on colour alone.

837

Total Clients

14.20%

Pendulum badge

Used in sales-dashboard.html

A delta pill hanging from a thread, gently swinging. The icon, the three-up footer and the pill all share one accent colour. motion-reduce:animate-none stops the motion for anyone who asked the OS to reduce it.

+31.2%

Stores have sold

$331,224

Outlets

4

Orders

8.2K

Growth

+31%

Sparkline

Used in customer-list.html

An ApexCharts bar sparkline over the last eight periods. The final bar is the headline figure above it, so the two cannot disagree. Add an entry to CARDS in customer-kpi-charts.js keyed by the mount id, with a data array.

Total Customer

876

Live

+54

New

3.1y

Avg tenure

4.2%

Growth

Tick meter

Used in hr-dashboard.html

Full-height ticks where the filled proportion is at full strength and the rest is faded, so the row reads as progress toward a target rather than as a series. Same component as the sparkline, declared with shape: "meter" and a pct.

324

Attendance

12.32%

of 348 staff present

Meter above the label

Used in crypto-dashboard.html

The same meter placed above the metric instead of below it, which suits a tile that leads with its chart. Mount id and configuration are identical — only the position in the card changes.

Market Cap

$2.38T

2.4%

Progress ring

Used in crypto-market.html

An inline SVG ring for a single share-of-whole figure. stroke-dasharray is the arc length against the circumference — a measurement, not a decoration. The percentage is real text inside the ring, and the SVG is aria-hidden so the figure is read rather than inferred from an arc. No JavaScript.

Total market cap

$1.44 T

92%
Top 4 assets $1320.00B / $1442.29B

Area chart hero

Used in coin.html

A ranked card with a full-bleed area line and a three-metric footer. The line uses preserveAspectRatio="none" so it spans any width, with vector-effect="non-scaling-stroke" keeping the stroke crisp. Flat tint, no gradient.

1, trending rank Injective INJ / USDT
$28.42 9.64%
Search
+412%
Volume
$684.2M
Cap
$2.84B

Card grid

Used in every dashboard

The wrapper the cards above sit in. Pick steps that divide the card count evenly — four cards on a lg:grid-cols-3 step strand one alone on a second row. 1 → 2 → 4 all divide four.

Revenue

$48,290

+12.4% vs last month

Orders

1,284

+3.1% vs last month

Refunds

24

−1.8% vs last month

Guidance

Conventions these cards follow across the project.

  • Derive, don't retype

    A card's footer should be computed from the same figures as its headline. When both are typed by hand they drift apart, and the card ends up contradicting itself.

  • Charts need a measured height

    An ApexCharts mount has no content of its own. Give the wrapper an explicit height — h-14 for a sparkline, h-8 for a meter. A percentage height against an auto-height parent collapses to zero.

  • Keep rows divisible

    Pick grid steps that divide the card count evenly. Four cards on a lg:grid-cols-3 step strand one alone on a second row, leaving a visible gap.

  • Colour is never the only signal

    Pair every delta colour with an arrow and a sign. A red figure alone is unreadable to anyone who cannot separate it from green.