Stat Card

React stat card with a label, optional icon, a large tabular value and a delta chip colored by its sign, with invertDelta for metrics like churn or latency.

src/registry/ui/stat-card.tsx/r/stat-card.json

Installation#

bash
npx shadcn@latest add @minidev/stat-card

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/stat-card.json

Usage#

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

export function Example() {
  return (
    <StatCard className="w-56" label="Latency" value="142ms" delta="p95" />
  )
}

API reference#

StatCard props
PropTypeDefault
label*React.ReactNode-
value*React.ReactNode-
deltaReact.ReactNode-
iconReact.ReactNode-
footnoteReact.ReactNode-
invertDeltaboolean-
classNamestring-

* required

Examples#

All dashboard components

Learn more