Dashboard Style Grid
A 4-tile-per-row dashboard-style grid where each card shows a label, a large value, a trend delta (direction arrow plus percentage) versus the prior period, and a small inline sparkline built from fixed-height bars. Designed to read like a mini analytics overview panel.
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/dashboard-style-grid.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats6.tsx instead.
Usage
The file also exports stats6Demo, 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 { Stats6, stats6Demo } from "@/components/blocks/stats/stats6"; export default function Page() { return <Stats6 {...stats6Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | undefined | Optional heading above the grid. |
| description | string | undefined | Optional supporting text under the heading. |
| stats | DashboardStat[] | none | The dashboard tiles rendered in the grid. |
| className | string | none | Extra classes for the outer section element. |
Types
type DashboardStat = { label: string; value: string; deltaPct: number; // signed; negative renders a down arrow trend: number[]; // fixed bar-height values for the inline sparkline };
Behavior notes
- Fully static: the sparkline bar heights are computed from the fixed trend array prop (each bar's height is a percentage of the max value in that stat's array), never from Math.random, so the chart looks identical on every render including card thumbnails.
- Direction is communicated with an ArrowUp/ArrowDown icon rather than color, since the design system has no semantic green/red tokens; a positive delta uses text-primary for the number and arrow, a negative delta uses text-muted-foreground, but the icon shape itself is what actually conveys direction (readable even without color).
- The sparkline bars are marked aria-hidden since they're a decorative restatement of the same trend the delta percentage already states in text; no separate accessible description is provided for the bar chart itself.
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.
Before After Comparison
Two-column before/after comparison of the same metrics, with the after column highlighted to signal improvement.