Staaarter

Stats With Background Pattern

A centered heading above four stat tiles, with a low-opacity repeating dot-grid pattern layered behind the content for texture. The pattern is a plain inline radial-gradient background, no images or extra dependencies.

By Staaarter Team
Stats
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/stats-with-background-pattern.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats15.tsx instead.

Usage

The file also exports stats15Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Stats15, stats15Demo } from "@/components/blocks/stats/stats15";

export default function Page() {
  return <Stats15 {...stats15Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstringundefinedSmall label above the heading.
headingstringnoneSection heading.
descriptionstringundefinedOptional supporting sentence under the heading.
statsStatTile[]noneStat tiles rendered in a 4-column grid on larger screens.
classNamestringnoneExtra classes for the outer section element.

Types

type StatTile = {
  label: string;
  value: string;
};

Behavior notes

  • The dot-grid background is a static CSS radial-gradient set via inline style on an absolutely-positioned, aria-hidden div behind the content; it does not respond to scroll or interaction.
  • The pattern uses currentColor at low opacity (text-foreground/[0.08]) so it stays subtle in both light and dark theme without a separate dark-mode override.
  • Stat tiles render in a fixed 2-column (mobile) / 4-column (sm and up) grid; the block always renders exactly the tiles it's given, there is no truncation or 'show more'.