# Stats Card 1 - Metric Card with Trend

> A compact metric card displaying a value with trend indicator showing percentage change and direction.

A shadcn/ui block from the [@shadcnblocks](https://shadcnblocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnblocks/stats-card1).

- Page, with a live preview: https://shadcn.exchange/r/shadcnblocks/stats-card1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/stats-card1-light-55d40bad2b81f896.png
- Registry item: https://shadcnblocks.com/r/stats-card1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnblocks.com/r/stats-card1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `cn`, `lucide-react`
- Registry items: `card`

## Files

### `block/stats-card1/stats-card1.tsx`

```tsx
import { TrendingDown, TrendingUp } from "lucide-react";
import { cn } from "cn";

import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
interface StatsCard1Props {
  title?: string;
  value?: string;
  change?: number;
  changeLabel?: string;
  className?: string;
}

const StatsCard1 = ({
  title = "Total Revenue",
  value = "$45,231.89",
  change = 20.1,
  changeLabel = "from last month",
  className,
}: StatsCard1Props) => {
  const isPositive = change >= 0;

  return (
    <Card className={cn("w-full max-w-xs", className)}>
      <CardHeader className="pb-2">
        <CardTitle className="text-sm font-medium text-muted-foreground">
          {title}
        </CardTitle>
      </CardHeader>
      <CardContent>
        <div className="text-3xl font-bold">{value}</div>
        <div className="mt-1 flex items-center gap-1 text-sm">
          {isPositive ? (
            <TrendingUp className="size-4 text-green-500" />
          ) : (
            <TrendingDown className="size-4 text-red-500" />
          )}
          <span className={isPositive ? "text-green-500" : "text-red-500"}>
            {isPositive ? "+" : ""}
            {change}%
          </span>
          <span className="text-muted-foreground">{changeLabel}</span>
        </div>
      </CardContent>
    </Card>
  );
};

export { StatsCard1 };
```
