Skip to content
Blocks

Metrics Strip

A complete metrics strip section, ready to adapt to your product.

Open ↗

Make it yours.

Install the editable source and its dependencies into your React + Tailwind project.

Scroll horizontally for long lines
pnpm dlx shadcn@4.0.8 add http://localhost:3000/r/metrics-strip.json

Use it

Scroll horizontally for long lines
"use client";
import {MetricsStrip} from '@/components/jez-ui/blocks/metrics-strip';

export default function Example(){

return <><MetricsStrip/></>;
}

Props & types

Scroll horizontally for long lines
{
  items?: { label: string; value: string }[];
  className?: string;
}

Source

View 2 source files

registry/blocks/metrics-strip.tsx

Scroll horizontally for long lines
"use client";
import * as React from "react";
import { cn } from "../ui/utils";
export function MetricsStrip({
  items = [
    { label: "Projects in this demo", value: "12" },
    { label: "Open tasks", value: "38" },
    { label: "Teammates", value: "6" },
  ],
  className,
}: {
  items?: { label: string; value: string }[];
  className?: string;
}) {
  return (
    <dl
      className={cn(
        "grid gap-6 border-y border-border py-7 sm:grid-cols-3",
        className,
      )}
    >
      {items.map((i) => (
        <div key={i.label}>
          <dt className="text-sm text-muted-foreground">{i.label}</dt>
          <dd className="mt-2 font-display text-3xl tabular-nums">{i.value}</dd>
        </div>
      ))}
    </dl>
  );
}

registry/ui/utils.ts

Scroll horizontally for long lines
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...values: ClassValue[]) {
  return twMerge(clsx(values));
}

Dependencies

clsx@2.1.1 · tailwind-merge@3.5.0

Accessibility & behaviour

Provide meaningful labels and preserve keyboard focus styles. Check contrast when customising theme colours.

Read the accessibility and performance guide →