Marvin Kaunda

Stat Card

Cards

About

A glassmorphic card that displays a labeled numeric stat with a trend or supporting description, used for dashboard and analytics 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 StatCard, {
  StatCardLabel,
  StatCardValue,
  StatCardDescription,
} from "@/components/ui/stat-card";

const stats = [
  { label: "Revenue", value: "$24.5k", change: "+12%" },
  { label: "Users", value: "8,291", change: "+4%" },
  { label: "Orders", value: "1,429", change: "+8%" },
  { label: "Bounce", value: "42%", change: "-3%" },
];

export default function StatCardDemo() {
  return (
    <div
      className="w-full min-h-screen flex items-center justify-center p-8"
      style={{ background: "oklch(0.16 0.035 275)", color: "oklch(0.98 0 0)" }}
    >
      <div className="grid grid-cols-2 md:grid-cols-4 gap-4 w-full max-w-2xl">
        {stats.map((stat) => (
          <StatCard key={stat.label}>
            <StatCardLabel>{stat.label}</StatCardLabel>
            <StatCardValue>{stat.value}</StatCardValue>
            <StatCardDescription>{stat.change}</StatCardDescription>
          </StatCard>
        ))}
      </div>
    </div>
  );
}

More by Marvin Kaunda

View all
  • Card Resize Toggle

    Card Resize Toggle

    5
  • Modal Transition

    Modal Transition

    1
  • Panel Reveal

    Panel Reveal

  • Number Pop In

    Number Pop In

  • Rating

    Rating

  • Steps

    Steps

  • Page Slide Transition

    Page Slide Transition

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Photo Deck

    Photo Deck

    47
  • Folded Card

    Folded Card

    45
  • Statistics Card 10

    Statistics Card 10

    304
  • Statistics Card 2

    Statistics Card 2

    309
  • Statistics Card 7

    Statistics Card 7

    336
  • CTA Section

    CTA Section

    6
  • Liquid Glass Card

    Liquid Glass Card

    198