Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/stats-with-map-visual.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats8.tsx instead.
Usage
The file also exports stats8Demo, 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 { Stats8, stats8Demo } from "@/components/blocks/stats/stats8"; export default function Page() { return <Stats8 {...stats8Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| badge | { label: string; variant?: BadgeVariant } | none | Pill above the heading; only rendered when badge is truthy. |
| heading | string | undefined | Section heading. |
| description | string | undefined | Section intro text. |
| stats | StatItem[] | none | Stat tiles rendered in a 2-column grid next to the graphic. |
| className | string | none | Extra classes for the outer section element. |
Types
type StatItem = { value: string; label: string };
Behavior notes
- The dot-cluster graphic is a decorative, abstract visual only, it is not a map and carries no geographic data or accuracy claims.
- Dot positions come from a fixed set of concentric rings computed with plain arithmetic at module scope; the same 48 dots render every time, so there is no randomness and no hydration mismatch.
- The graphic is purely presentational (aria-hidden) and has no relationship to the stat values shown beside it.
More Stats Blocks
View all →Simple Four Stat Row
A plain 4-column row of big numbers with labels, no icons or chrome.
Stats With Icons
Bordered stat tiles, each topped with a lucide icon above the number.
Big Hero Stat
One dominant, oversized stat with smaller supporting stats below it.
Stats With Progress Bars
A vertical list of stats, each paired with a horizontal progress bar toward a goal.
Animated Counter Row
A 4-stat row whose numbers count up from 0 on mount.
Dashboard Style Grid
A dense analytics-dashboard grid with trend deltas and inline sparklines.