Skip to main content
Version: 1.0.3

Stats Grid

The StatsGrid component provides a flexible and customizable way to display statistical data with beautiful animations, multiple themes, and intelligent number formatting.

Stats: 6

Simple Stats Grid Demo

Basic customization with light/dark themes and layout options

Active Users

0

Growing 20% month over month

Uptime SLA

0.0%

Enterprise-grade reliability

Annual Revenue

$0

Record growth this quarter

Total Downloads

0+

Across all platforms

App Store Rating

0

Based on 50K+ reviews

Customer Satisfaction

0.0%

NPS Score

Installation

ignix add component statsGrid

Usage

The StatsGrid component can be used in two ways: via a simple props-based API for quick implementation, or using compound components for maximum layout flexibility.

Quick Start

Pass an array of stats to the StatsGrid component to quickly render a responsive grid with animations.

import { StatsGrid } from '@ignix-ui/stats-grid';
import { Users, DollarSign, Activity } from 'lucide-react';

const stats = [
{
label: 'Total Users',
value: 12500,
icon: Users,
accent: 'blue',
format: 'compact'
},
{
label: 'Revenue',
value: 45200,
icon: DollarSign,
accent: 'emerald',
format: 'currency'
},
{
label: 'Growth',
value: 24,
icon: Activity,
accent: 'rose',
format: 'percentage',
suffix: '+'
}
];

export default function MyDashboard() {
return (
<StatsGrid
title="Platform Overview"
description="Real-time performance metrics for your application."
stats={stats}
columns={3}
variant="default"
/>
);
}

Custom Composition

Use compound components to build custom card layouts or add non-standard content between grid items.

import { 
StatsGrid,
StatsGridContainer,
StatsGridCard,
StatValue,
StatLabel
} from '@ignix-ui/stats-grid';

export default function CustomStats() {
return (
<StatsGrid variant="dark" columns={2}>
<StatsGrid.Header
title="Custom Layout"
description="Mixing pre-built cards with custom markup."
/>
<StatsGridContainer>
{/* Standard Card */}
<StatsGridCard
stat={{ label: 'Active Sessions', value: 842 }}
/>

{/* Custom Card */}
<div className="p-6 bg-gray-800 rounded-xl border border-gray-700">
<StatLabel color="text-primary-400">System Uptime</StatLabel>
<StatValue value={99.9} format="percentage" />
<div className="mt-2 text-xs text-gray-500">Last 30 days</div>
</div>
</StatsGridContainer>
</StatsGrid>
);
}

Props

StatsGrid Props

PropTypeDefaultDescription
variant'default' | 'dark' | 'light''default'Visual variant of the stats grid
columns2 | 3 | 4 | 5 | 64Number of columns in the grid
contentAlign'left' | 'center' | 'right''center'Content alignment within the section
animatedbooleantrueEnable/disable counting animations
animationDelaynumber0Initial animation delay in seconds
animationType'fade' | 'slide' | 'scale' | 'none''slide'Type of entrance animation
staggerDelaynumber0.1Delay between each card's animation
padding'sm' | 'md' | 'lg' | 'xl' | '2xl''lg'Vertical padding of the section
gap'sm' | 'md' | 'lg' | 'xl''md'Gap between grid items
containerSize'small' | 'normal' | 'large' | 'full' | 'readable''normal'Container max width
bgColorstring-Custom background color class for the section
textColorstring-Custom text color class for the section
cardBgColorstring-Custom background color class for cards
cardBorderColorstring-Custom border color class for cards
cardBorderWidthstring-Custom border width for cards
iconBgColorstring-Custom background color class for icons
iconColorstring-Custom icon color class
titlestring-Section title (when using default rendering)
descriptionstring-Section description (when using default rendering)
statsStatItem[][]Statistics array (when using default rendering)
ariaLabelstring-Accessibility label
rolestring'region'ARIA role
childrenReact.ReactNode-Child components for custom layouts

StatsGridTitle

PropTypeDefaultDescription
childrenReact.ReactNoderequiredTitle content
classNamestring-Additional CSS classes
as'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6''h2'HTML heading element
colorstring-Custom text color class

StatsGridDescription

PropTypeDefaultDescription
childrenReact.ReactNoderequiredDescription content
classNamestring-Additional CSS classes
colorstring-Custom text color class

StatsGridCard

PropTypeDefaultDescription
statStatItemrequiredStatistic data
indexnumber0Card index (for staggered animations)
classNamestring-Additional CSS classes
bgColorstring-Custom background color for this card
borderColorstring-Custom border color for this card
borderWidthstring-Custom border width for this card
textColorstring-Custom text color for this card
iconBgColorstring-Custom icon background for this card
iconColorstring-Custom icon color for this card
iconSolidbooleanfalseUse solid vibrant icon style

StatsGridContainer

PropTypeDefaultDescription
childrenReact.ReactNoderequiredGrid items (usually StatsGridCard components)
classNamestring-Additional CSS classes

StatsGridHeader

PropTypeDefaultDescription
titlestring-Section title
descriptionstring-Section description
classNamestring-Additional CSS classes

StatValue

PropTypeDefaultDescription
valuenumberrequiredNumeric value to display
format'raw' | 'compact' | 'currency' | 'percentage''compact'Number formatting style
prefixstring''Text before the value
suffixstring''Text after the value
decimalsnumber1Number of decimal places
animatedbooleantrueEnable counting animation
delaynumber0Animation delay in seconds
classNamestring-Additional CSS classes
as'p' | 'span' | 'div''p'HTML element
colorstring-Custom text color class

StatLabel

PropTypeDefaultDescription
childrenReact.ReactNoderequiredLabel content
classNamestring-Additional CSS classes
as'p' | 'span' | 'div' | 'h3' | 'h4''p'HTML element
colorstring-Custom text color class

StatSubtext

PropTypeDefaultDescription
childrenReact.ReactNoderequiredSubtext content
classNamestring-Additional CSS classes
as'p' | 'span' | 'div''p'HTML element
colorstring-Custom text color class

StatIcon

PropTypeDefaultDescription
iconLucideIconrequiredIcon component from lucide-react
accent'default' | 'blue' | 'emerald' | 'amber' | 'rose' | 'violet' | 'purple' | 'pink' | 'indigo' | 'cyan' | 'orange' | 'yellow' | 'teal' | 'red' | 'green''default'Accent color variant
size'sm' | 'md' | 'lg''md'Icon size
bgColorstring-Custom background color class
iconColorstring-Custom icon color class
solidbooleanfalseUse solid vibrant colors instead of light backgrounds
classNamestring-Additional CSS classes

StatItem Interface

PropTypeDefaultDescription
idstring-Unique identifier
valuenumberrequiredNumeric value
labelstringrequiredStatistic label
subtextstring-Additional description
iconLucideIcon-Icon component
formatNumberFormat'compact'Number formatting style
prefixstring''Text before the value
suffixstring''Text after the value
decimalsnumber1Number of decimal places
accentStatAccent'default'Accent color for the icon