Skip to content
caliper ui docs

Components

Stat card

A bordered figure with a label, description and change.

Free
pnpm dlx shadcn@latest add @caliper/stat-card

Billing summary

Halden workspace · October 2026

Monthly revenue
$48,200

Compared with last month

+8.2%
Net new MRR
$3,640

12 upgrades, 3 downgrades

+$910
Installs components/ui/stat-card.tsxDepends on none beyond ReactMotion none in component source

When to use

Use it for

  • A small grid of key numbers.
  • Summaries on a billing or reports page.

Skip it when

  • The number needs a trend; use a metric.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/stat-card

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

This is the code behind the preview above.

example.tsx
import { type ReactNode } from "react"
import { StatCard } from "@/components/ui/stat-card"
import { Badge } from "@/components/ui/badge"
import { cn } from "@/components/ui/lib/cn"

function Panel({ title, context, action, className, children }: { title: string; context: string; action?: ReactNode; className?: string; children: ReactNode }) {
  return (
    <section className={cn("grid w-full max-w-md min-w-0 gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting", className)}>
      <div className="flex flex-wrap items-start justify-between gap-3">
        <div className="grid min-w-0 gap-1">
          <p className="font-medium">{title}</p>
          <p className="text-sm text-muted-foreground">{context}</p>
        </div>
        {action}
      </div>
      {children}
    </section>
  );
}

export function RevenueStat() {
  return (
    <Panel title="Billing summary" context="Halden workspace · October 2026">
      <div className="grid grid-cols-2 gap-x-6 border-t border-border">
        <StatCard label="Monthly revenue" value="$48,200" description="Compared with last month" change={<Badge variant="success">+8.2%</Badge>} />
        <StatCard label="Net new MRR" value="$3,640" description="12 upgrades, 3 downgrades" change={<Badge variant="success">+$910</Badge>} />
      </div>
    </Panel>
  );
}

API reference

StatCard

component

Also accepts the native props of its root element and a ref.

PropTypeDefault
label *string—
value *string | number—
descriptionstring—
changeReactNode—

Accessibility

It is built on native elements, so roles and focus come from the browser.

No custom key handling; Tab and the native activation keys do the work.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Blocks examples