About
A bordered figure showing a labeled number with an optional description and a change badge, used for key metrics in billing or report summaries.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Stat Card to your project and fits it to your theme.
Code
How Stat Card is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { type ReactNode } from "react";
import { StatCard } from "@/components/ui/stat-card";
import { Badge } from "@/components/ui/stat-card-utils/badge";
import { cn } from "@/components/ui/stat-card-utils/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 default function StatCardDemo() {
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>
);
}
















