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/trend-arrow-stats.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats11.tsx instead.
Usage
The file also exports stats11Demo, 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 { Stats11, stats11Demo } from "@/components/blocks/stats/stats11"; export default function Page() { return <Stats11 {...stats11Demo} />; }
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 | TrendStat[] | none | Stat tiles, each carrying its own trend direction and delta. |
| className | string | none | Extra classes for the outer section element. |
Types
type TrendStat = { label: string; value: string; delta: string; direction: "up" | "down"; };
Behavior notes
- The arrow icon and text tone are chosen purely from each item's direction prop ("up" renders ArrowUp in text-primary, "down" renders ArrowDown in text-muted-foreground); this is a static mapping evaluated at render time, not a live computation from the value or delta.
- direction is descriptive metadata supplied by the caller, it does not imply whether the change is good or bad for the metric in question (e.g. a falling churn rate is still rendered with direction: "down").
- No literal red/green colors are used anywhere; tone is conveyed with semantic tokens only.
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.