{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"stat-card","type":"registry:ui","title":"Stat card","description":"A bordered figure with a label, description and change.","dependencies":["clsx","tailwind-merge"],"registryDependencies":["https://caliperui.site/r/styles.json"],"files":[{"path":"ui/lib/cn.ts","type":"registry:ui","target":"components/ui/lib/cn.ts","content":"import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({\n  extend: { theme: { radius: [\"control\", \"surface\", \"overlay\"], shadow: [\"overlay\"] } },\n});\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n"},{"path":"ui/stat-card.tsx","type":"registry:ui","target":"components/ui/stat-card.tsx","content":"import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"./lib/cn\";\n\nexport type StatCardProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n  label: string;\n  value: string | number;\n  description?: string;\n  change?: ReactNode;\n};\n\nexport function StatCard({\n  label,\n  value,\n  description,\n  change,\n  className,\n  ...props\n}: StatCardProps) {\n  return (\n    <div\n      data-slot=\"stat-card\"\n      className={cn(\"min-w-0 py-4 [overflow-wrap:anywhere]\", className)}\n      {...props}\n    >\n      <dl>\n        <dt className=\"text-xs text-muted-foreground\">{label}</dt>\n        <dd className=\"mt-2 text-2xl leading-8 font-medium tabular-nums\">\n          {value}\n        </dd>\n      </dl>\n      {description && (\n        <p className=\"mt-2 text-xs leading-5 text-muted-foreground\">\n          {description}\n        </p>\n      )}\n      {change != null && <div className=\"mt-2 text-xs leading-5\">{change}</div>}\n    </div>\n  );\n}\n"}],"categories":["data"],"meta":{"tier":"free","license":"MIT","family":"blocks","docs":"/docs/components/stat-card"}}