Skip to main content
BlocksStatsJoined KPI strip with percentage deltas

shadcn/ui Stats block for Base UIJoined KPI strip with percentage deltas

A four-up KPI strip built with shadcn/ui Card components joined by hairline borders into a single rounded panel. Each cell shows a metric label, a large tabular value and a positive or negative percentage delta styled with theme tokens. Ideal as the headline row of an analytics or operations dashboard.

Free@shadcnpro/base/stats-01

Preview

Installation

npx shadcn@latest add @shadcnpro/base/stats-01

First time? Add the @shadcnpro registry to components.json as shown in Installation. Free blocks install without a license key.

Let your AI editor install it

The shadcn/ui Pro MCP server lets Cursor, Claude Code and VS Code find and install blocks like Joined KPI strip with percentage deltas from one prompt. It is included in every Pro plan.

Add the shadcn/ui components

Joined KPI strip with percentage deltas uses Card, from the Base UI components set up in your components.json.

npx shadcn@latest add card

Copy the code

Paste it into components/blocks/stats-01.tsx.

components/blocks/stats-01.tsx
'use client';

import { Card, CardContent } from '@/components/ui/card';
import { cn } from '@/lib/utils';

const data = [
  {
    name: 'Messages delivered',
    value: '4,812,390',
    change: '+6.4%',
    changeType: 'positive',
  },
  {
    name: 'Hard bounces',
    value: '18,204',
    change: '-3.1%',
    changeType: 'negative',
  },
  {
    name: 'Webhook events',
    value: '1,297,518',
    change: '+2.2%',
    changeType: 'positive',
  },
  {
    name: 'Spam complaints',
    value: '412',
    change: '-0.8%',
    changeType: 'negative',
  },
];

/**
 * Joined KPI strip with percentage deltas.
 */
export default function Stats01() {
  return (
    <div className="w-full max-w-5xl px-4">
      <div className="mx-auto grid grid-cols-1 gap-px overflow-hidden rounded-xl border border-border bg-border sm:grid-cols-2 lg:grid-cols-4">
        {data.map((stat) => (
          <Card
            className="rounded-none border-0 py-0 shadow-none"
            key={stat.name}
          >
            <CardContent className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2 p-4 sm:p-6">
              <div className="font-medium text-muted-foreground text-sm">
                {stat.name}
              </div>
              <div
                className={cn(
                  'font-medium text-xs tabular-nums',
                  stat.changeType === 'positive'
                    ? 'text-primary'
                    : 'text-destructive'
                )}
              >
                {stat.change}
              </div>
              <div className="w-full flex-none font-medium text-3xl text-foreground tabular-nums tracking-tight">
                {stat.value}
              </div>
            </CardContent>
          </Card>
        ))}
      </div>
    </div>
  );
}

Use it

Import it where you need it and update the import path to match your project.

Usage
import Stats01 from '@/components/blocks/stats-01';

export default function Page() {
  return <Stats01 />;
}

Overview

Joined KPI strip with percentage deltas is a free stats block for shadcn/ui and Base UI. It is built from the Card component, and installs as a single file you own and can edit.

It only uses semantic tokens such as bg-background, text-muted-foreground and border-border, so it follows your theme, radius and fonts and switches with dark mode. It is responsive from desktop to mobile; the width controls above the preview show each size. The same layout is in the shadcn/ui Pro Figma kit, so design and code start from one source.

Category
Stats
Component library
Base UI (@base-ui/react)
Also available for
Radix UI, React Aria
Built with
Card
npm packages
None
Files
components/blocks/stats-01.tsx
Access
Free, installs without a license key

Frequently asked questions

Pricing, installation and Base UI details for Joined KPI strip with percentage deltas.