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/compact-inline-bar.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats12.tsx instead.
Usage
The file also exports stats12Demo, 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 { Stats12, stats12Demo } from "@/components/blocks/stats/stats12"; export default function Page() { return <Stats12 {...stats12Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| stats | InlineStat[] | none | Label/value pairs rendered in a single wrapping row. |
| className | string | none | Extra classes for the outer section element. |
Types
type InlineStat = { label: string; value: string };
Behavior notes
- This block intentionally uses tighter vertical padding (py-4) than the rest of the stats category's py-16 sm:py-24 sections, since it's designed to sit inline rather than as a standalone page section.
- Dividers are plain border-l elements between items (skipped on the first item); on narrow screens the row wraps and a wrapped item simply loses its leading divider along with its left margin, there is no separate mobile layout.
- Entirely static: no computation, just a direct render of the stats array in order.
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.