Ranked Leaderboard Stats
A ranked list of 5-6 rows, each showing a rank number, a name, and a metric value, with a subtle bar-width fill behind the row proportional to a supplied width percentage. Suited to "top regions", "top products", or any other ranked-comparison stat block.
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/ranked-leaderboard-stats.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats14.tsx instead.
Usage
The file also exports stats14Demo, 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 { Stats14, stats14Demo } from "@/components/blocks/stats/stats14"; export default function Page() { return <Stats14 {...stats14Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | undefined | Small label above the heading. |
| heading | string | none | Section heading. |
| description | string | undefined | Optional supporting sentence under the heading. |
| rows | LeaderboardRow[] | none | Ranked rows, rendered in the order supplied (index + 1 is the displayed rank). |
| className | string | none | Extra classes for the outer section element. |
Types
type LeaderboardRow = { name: string; value: string; /** Bar width as a percentage of the row's track, 0-100. Author-supplied, not computed from value. */ barWidth: number; };
Behavior notes
- Rank numbers are derived from array position (index + 1), not from a separate rank field, so the caller controls order by array order.
- barWidth is a plain author-supplied percentage rendered as a div's inline width style; it is not computed from value, so the caller is responsible for keeping the two visually consistent.
- Static and non-interactive: the bar fill renders at its final width immediately, there is no grow-in animation.
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.