CD-13Cards
Metric Card
A revenue KPI card. Scrub a day, drag a range, or pick a segment; the number rolls, the line morphs and the breakdown follows.
PROBuilding a billing page? Billing and Usage is in Kokonut UI Pro
Installation
Metric Card is a free, open-source React component in the Kokonut UI Cards collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/metric-card.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/metric-cardUsage
import MetricCard from "@/components/kokonutui/metric-card";
export default function Example() {
return <MetricCard />;
}Props
labelstringDefault "Revenue"segmentsstring[]Default ["Plans", "Usage", "Services"]Names of the parts that add up to the metric.
dataMetricPoint[]Default built-inDaily values, oldest first. Needs twice the longest period, so each period has one to compare with.
eventsMetricEvent[]Default built-inDays worth a note, such as a launch or a price change. Pinned on the chart.
periodsnumber[]Default [7, 30, 90]defaultPeriodnumberDefault 30format"currency" | "number"Default "currency"currencystringDefault "USD"classNamestringExtra classes for the root element.
MetricPoint
daterequiredstringYYYY-MM-DD
partsrequirednumber[]One value per segment, in the order of segments.
MetricEvent
daterequiredstringYYYY-MM-DD
labelrequiredstringDependencies
| Needs | Version | Comes from |
|---|---|---|
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.

