Revenue
$48,290
+12.4% vs last month
Active users
3,912
-2.1% vs last month
Installation
$ pnpm dlx shadcn@latest add @synccn/stat-cardFirst time in this project? Connect synccn with one command.
Usage
import { StatCard } from "@/components/ui/stat-card";<StatCard label="Revenue" value="$48,290" change={12.4} />API reference
Generated from the component's TypeScript types, so it always matches the code.
StatCard
KPI tile: label, value, change since last period and a trend line.
- labelrequired
React.ReactNodeWhat the number measures.
- valuerequired
React.ReactNodeFormatted value.
- change
numberPercentage change since last period.
- changeLabel
stringDefault
"vs last month"What the change is measured against.
- goodWhen
"up" | "down"Default
"up"Whether a rise is good news (revenue) or bad news (error rate, latency). Sets the colour.
- trend
number[]Values for the sparkline.
- icon
React.ElementTypeIcon in the corner.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Components
- Bar Chart for
Sparkline
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for TrendingDown, TrendingUp
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
No ARIA roles, key handling or motion settings in its source. It renders plain elements, so its accessibility comes from the content and labels you give it.