074
One number with its own hand-drawn chart: switch the range and the lines reshape, scrub with a pointer or the arrow keys for exact figures, and the headline follows wherever you are.
akakpi·line chart
Run this in any project set up for the shadcn CLI. It copies the Metric Card source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/metric-card.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { MetricCard } from "@/components/metric-card";
export default function Page() {
return <MetricCard />;
}A free React component in the Numbers collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the Metric Card source. Everything is optional unless it says required.
| Prop | Type | Default |
|---|---|---|
| title | string | "Active users" |
| series | MetricSeries[] | defaultSeries |
| ranges | MetricRange[] | defaultRanges |
| defaultRange | string | — |
| format | Intl.NumberFormatOptions | { maximumFractionDigits: 0 } |
| locale | string | "en-US" |
| className | string | — |