StatsCard
Metric card for displaying KPIs, financial figures, and operational stats in ERP dashboard layouts. Monospace value display with trend indicators.
Installation
$ npx shadcn@latest add stats-cardPreview
ARR Revenue
$48,291,040
+14.2% QoQActive Staff
842 Employees
+12 New hires this weekActive Fleet
418 Vehicles
99.1% OperationalUsage (React/TSX)
import { StatsCard } from "@/components/ui/stats-card"
import { DollarSign, Users, Truck } from "lucide-react"
export default function Dashboard() {
return (
<div className="grid grid-cols-3 gap-4">
<StatsCard
label="ARR Revenue"
value="$48,291,040"
trend={{ value: "+14.2% QoQ", direction: "up" }}
icon={<DollarSign className="w-4 h-4" />}
/>
<StatsCard
label="Operating Costs"
value="$12,408,550"
trend={{ value: "-2.1% Cost reduction", direction: "down" }}
/>
<StatsCard
label="Server Load"
value="41.2%"
trend={{ value: "Autoscaling healthy", direction: "neutral" }}
/>
</div>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | The metric label (displayed uppercase). |
| value | string | — | The metric value (displayed in monospace). |
| trend | { value: string, direction: 'up' | 'down' | 'neutral' } | — | Optional trend indicator with direction. |
| icon | ReactNode | — | Optional icon in the top-right corner. |
| className | string | — | Additional CSS classes to apply. |