Skip to main content

Stat Card

A versatile statistics card with icon, title, main/secondary stats, metrics grid, and extensible footer slot. Includes loading skeleton states and compound components for custom layouts.

Installation

$ npx shadcn@latest add @orecus/stat-card
Dependencies:
lucide-reactmotion
Registry:
skeleton@orecus/color-utils@orecus/card@orecus/header@orecus/use-reduced-motion@orecus/use-animated-number

Component

Full-featured stat cards with metrics, secondary stats, and animations.

With metrics grid

Revenue Overview

Monthly performance metrics

Total Revenue

vs Last Month

Customers
Growth
Orders

With accent styling

Analytics

Page Views

This Week

With footer

Sales Dashboard

Premium glass card with glow

Total Orders

Uptime
Rating
Footer content (e.g., sparkline chart)

Inverted style

Conversion Rate

Last 30 days performance

Conversion Rate

Props

PropTypeDefaultDescription
title*stringTitle text for the card header
icon*LucideIconIcon component to display in the header
descriptionReactNodeDescription text below the title
mainStat*StatValueMain statistic with value, label, and optional color
secondaryStatStatValueOptional secondary statistic displayed on the right
metricsStatMetric[]Array of metrics with icon, value, label, and color
metricsColumnsnumber3Number of columns for the metrics grid (1-4)
actionReactNodeOptional action content in the header (e.g., button)
footerReactNodeOptional footer content (e.g., sparkline, progress bar)
cardPropsCardPropsProps to pass to the Card wrapper (type, hoverEffect, accentColor, etc.)
animatedbooleantrueWhether to animate elements on mount
animateValuebooleantrueWhether to animate numeric values with a counting effect
compactbooleanfalseCompact layout variant
loadingbooleanfalseShows skeleton loading state when true
classNamestringAdditional CSS classes for the card