Stat Card
manifest-ui/stat-cardFreeBlock
Scrollable stat cards with values, trends, and change indicators.
Install it
npx shadcn@latest add https://ui.manifest.build/r/stat-card.jsonSource
1"use client"23import { TrendingUp, TrendingDown, Minus } from "lucide-react"4import { cn } from "@/lib/utils"5import { demoStats } from './demo/miscellaneous'67/**8 * Represents a single statistic card with trend data.9 * @interface StatCard10 * @property {string} [label] - Label for the stat (e.g., "Sales", "Orders")11 * @property {string | number} [value] - The stat value to display12 * @property {number} [change] - Percentage change value13 * @property {string} [changeLabel] - Additional context for the change14 * @property {React.ReactNode} [icon] - Optional icon for the stat15 * @property {"up" | "down" | "neutral"} [trend] - Trend direction16 */17export interface StatCard {18 label?: string19 value?: string | number20 change?: number21 changeLabel?: string22 icon?: React.ReactNode23 trend?: "up" | "down" | "neutral"24}2526/**27 * ═══════════════════════════════════════════════════════════════════════════28 * StatCardProps29 * ═══════════════════════════════════════════════════════════════════════════30 *31 * Props for the StatCard component, which displays a grid of statistic cards32 * with values, trend indicators, and optional icons.33 */34export interface StatCardProps {35 data?: {36 /** Array of stat cards to display in the grid. */37 stats?: StatCard[]38 }39}404142/**43 * A statistics card grid displaying key metrics with trend indicators.44 * Shows stats in a responsive 2-3 column grid layout.45 *46 * Features:47 * - Trend indicators (up, down, neutral) with colors48 * - Percentage change display49 * - Optional icons per stat50 * - Responsive grid layout51 * - Optional change labels52 *53 * @component54 * @example55 * ```tsx56 * <StatCard57 * data={{58 * stats: [59 * { label: "Revenue", value: "$12,543", change: 12.5, trend: "up" },60 * { label: "Orders", value: "342", change: -3.2, trend: "down" },61 * { label: "Customers", value: "1,205", change: 0, trend: "neutral" }62 * ]63 * }}64 * />65 * ```66 */67export function StatCard({ data }: StatCardProps) {68 const resolved: NonNullable<StatCardProps['data']> = data ?? { stats: demoStats }69 const stats = resolved.stats ?? []70 const getTrendIcon = (trend?: "up" | "down" | "neutral") => {71 switch (trend) {72// … truncated
What it pulls in
npm packages
Files it writes
More from Manifest UI
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Amount Inputamount-input | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Chat Conversationchat-conversation | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Contact Formcontact-form | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Date & Time Pickerdate-time-picker | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Cardevent-card | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Confirmationevent-confirmation | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Detailevent-detail | Manifest UI | Blocks | Free | 3 deps · 2 files | |
| Event Listevent-list | Manifest UI | Blocks | Free | 3 deps · 2 files |
