Get GliaKit

Data display

Stat card

A KPI tile with a mono label, a large value and an optional trend delta compared with last month.

Source
src/components/ui/card.tsx
Figma
StatCard · trend (up, down, flat).

Usage

Included in the GliaKit boilerplate. Import it where you need it:

tsx
import { StatCard } from "@/components/ui/card";

When to use

  • Rows of headline metrics at the top of a dashboard: revenue, active users, churn.
  • Showing a single number with how it moved since the previous period.
  • For values over time, pair the tiles with a Chart instead of adding more tiles.
  • For anything other than a monthly comparison, build a Card yourself: the comparison text is fixed to "vs last month".

Examples

Without delta

Leave out delta for totals that have no comparison.

Dashboard row

KPI tiles above a chart card, the most common dashboard layout.

API reference

StatCard

Renders a Card with p-5. Does not spread other div props.

PropTypeDefaultDescription
labelstring-Required. Short uppercase mono label above the value.
valuestring-Required. The formatted metric, e.g. "$48,290". Pass it pre-formatted.
deltastring-Change since last month, e.g. "+12.5%". A leading + or - is stripped and replaced by the trend arrow. When omitted, the whole delta line is hidden.
trend"up" | "down" | "flat"-Arrow and color of the delta: up is green with ↑, down is red with ↓. flat, or no trend, is muted with →.
classNamestring-Extra classes for the card.

Accessibility

  • Label, value and delta are plain text, read in that order.
  • Trend is shown by an arrow character and the delta text, not by color alone. Screen readers announce the arrow, for example "upwards arrow".
  • The delta always reads "vs last month"; make sure that matches the period your data covers.

Related