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@orecus/animation

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*string—Title text for the card header
icon*LucideIcon—Icon component to display in the header
descriptionReactNode—Description text below the title
mainStat*StatValue—Main statistic with value, label, and optional color
secondaryStatStatValue—Optional 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)
actionReactNode—Optional action content in the header (e.g., button)
footerReactNode—Optional footer content (e.g., sparkline, progress bar)
cardPropsCardProps—Props 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
classNamestring—Additional CSS classes for the card