Ashish Sharma

Stat Card

Cards

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>
  );
}

More by Ashish Sharma

View all
  • Perspective Gallery

    Perspective Gallery

    149
  • Bento Features

    Bento Features

    27
  • Animated Sidebar

    Animated Sidebar

    25
  • Otp Input

    Otp Input

    25
  • Glow Ring

    Glow Ring

    20
  • Notification Stack

    Notification Stack

    11
  • Expandable Tabs

    Expandable Tabs

    11
  • Voice Orb

    Voice Orb

    8

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.4K
  • Stats cards with links

    Stats cards with links

    46
  • Statistics Card 7

    Statistics Card 7

    342
  • Statistics Card 2

    Statistics Card 2

    322
  • Card Studio

    Card Studio

    37
  • Card

    Card

    65
  • Admin Dashboard Cards

    Admin Dashboard Cards

    44
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    778