HelpTribe.

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-card

Preview

ARR Revenue
$48,291,040
+14.2% QoQ
Active Staff
842 Employees
+12 New hires this week
Active Fleet
418 Vehicles
99.1% Operational

Usage (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

PropTypeDefaultDescription
labelstring—The metric label (displayed uppercase).
valuestring—The metric value (displayed in monospace).
trend{ value: string, direction: 'up' | 'down' | 'neutral' }—Optional trend indicator with direction.
iconReactNode—Optional icon in the top-right corner.
classNamestring—Additional CSS classes to apply.