# With Stats

> A page title sitting above a row of key metrics like totals and trends. Use it on dashboards to frame the view and surface numbers at a glance.

A shadcn/ui block from the [@shadcn-ui-blocks](https://www.shadcn-ui-blocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcn-ui-blocks/application-page-headings-with-stats).

- Page, with a live preview: https://shadcn.exchange/r/shadcn-ui-blocks/application-page-headings-with-stats
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcn-ui-blocks/application-page-headings-with-stats-light-724d561f14e9bb2c.png
- Registry item: https://www.shadcn-ui-blocks.com/r/application-page-headings-with-stats.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://www.shadcn-ui-blocks.com/r/application-page-headings-with-stats.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: `lucide-react`

## Files

### `components/blocks/application/page-headings/with-stats.tsx`

```tsx
import { Card, CardContent } from "@/components/ui/card";
import {
  ArrowDown,
  ArrowUp,
  Users,
  DollarSign,
  ShoppingCart,
} from "lucide-react";

export default function PageHeadingWithStats() {
  return (
    <div className="container mx-auto px-4 py-16 md:px-6 2xl:max-w-[1400px]">
      <div className="mb-8">
        <h1 className="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl">
          Dashboard Overview
        </h1>
        <p className="text-muted-foreground mt-2">
          Your business performance at a glance
        </p>
      </div>

      <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
        <Card className="p-0">
          <CardContent className="flex items-center justify-between p-6">
            <div>
              <p className="text-muted-foreground text-sm font-medium">
                Total Customers
              </p>
              <h2 className="mt-2 text-3xl font-bold">2,543</h2>
              <p className="mt-1 flex items-center text-sm text-green-600">
                <ArrowUp className="mr-1 h-4 w-4" />
                12.5% from last month
              </p>
            </div>
            <Users className="text-muted-foreground h-8 w-8" />
          </CardContent>
        </Card>

        <Card className="p-0">
          <CardContent className="flex items-center justify-between p-6">
            <div>
              <p className="text-muted-foreground text-sm font-medium">
                Revenue
              </p>
              <h2 className="mt-2 text-3xl font-bold">$45,231</h2>
              <p className="mt-1 flex items-center text-sm text-red-600">
                <ArrowDown className="mr-1 h-4 w-4" />
                4.3% from last month
              </p>
            </div>
            <DollarSign className="text-muted-foreground h-8 w-8" />
          </CardContent>
        </Card>

        <Card className="p-0">
          <CardContent className="flex items-center justify-between p-6">
            <div>
              <p className="text-muted-foreground text-sm font-medium">
                Orders
              </p>
              <h2 className="mt-2 text-3xl font-bold">1,345</h2>
              <p className="mt-1 flex items-center text-sm text-green-600">
                <ArrowUp className="mr-1 h-4 w-4" />
                8.2% from last month
              </p>
            </div>
            <ShoppingCart className="text-muted-foreground h-8 w-8" />
          </CardContent>
        </Card>
      </div>
    </div>
  );
}
```

### `components/ui/card.tsx`

```tsx
import * as React from "react"

import { cn } from "@/lib/utils"

function Card({
  className,
  size = "default",
  ...props
}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
  return (
    <div
      data-slot="card"
      data-size={size}
      className={cn(
        "group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
        className
      )}
      {...props}
    />
  )
}

function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-header"
      className={cn(
        "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4",
        className
      )}
      {...props}
    />
  )
}

function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-title"
      className={cn(
        "font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",
        className
      )}
      {...props}
    />
  )
}

function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-description"
      className={cn("text-sm text-muted-foreground", className)}
      {...props}
    />
  )
}

function CardAction({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-action"
      className={cn(
        "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
        className
      )}
      {...props}
    />
  )
}

function CardContent({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-content"
      className={cn("px-6 group-data-[size=sm]/card:px-4", className)}
      {...props}
    />
  )
}

function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="card-footer"
      className={cn(
        "flex items-center rounded-b-xl px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4",
        className
      )}
      {...props}
    />
  )
}

export {
  Card,
  CardHeader,
  CardFooter,
  CardTitle,
  CardAction,
  CardDescription,
  CardContent,
}
```
