Skip to main content

Stat Badge

A compact inline badge for embedding stats in text or headers. Features pulse indicator, icons, glass effects, accent bars, hover/click interactions, and multiple variants.

Installation

$ npx shadcn@latest add @orecus/stat-badge
Dependencies:
lucide-react
Registry:
@orecus/color-utilsskeleton

Component

Compact badges for displaying stats inline or in tight spaces.

Basic Usage

Users2,847Orders142Uptime98%

Pulse Indicator

Live3 onlineRecording

Sizes

SmallMedium

Inline Usage

Our platform currently has 12,847 active users generating $48K in revenue.

Props

PropTypeDefaultDescription
value*string | numberValue to display
labelstringOptional label
iconLucideIconOptional icon
colorThemeColor'primary'Badge color - affects text/icon colors and accent bar
variant'default' | 'outline' | 'ghost''default'Visual variant
size'sm' | 'md''md'Badge size
pulsebooleanfalseShow pulsing dot indicator
type'normal' | 'subtle' | 'strong' | 'solid' | 'none''none'Glass effect style. When not 'none', replaces color-based background with glass
invertbooleanfalseInvert glass overlay approach (white-on-light, dark-on-dark)
accentBar'none' | 'top' | 'bottom''none'Gradient accent bar position
accentBarVariant'fade' | 'solid''fade'Accent bar gradient style
accentColorThemeColorColor for accent bar (defaults to color prop)
accentBarOnHoverbooleanfalseWhether accent bar appears only on hover
hoverEffect'none' | 'lift' | 'scale''none'Hover effect style
hoverBorderbooleanfalseWhether border color animates on hover using accentColor
onClick() => voidClick handler - makes badge interactive
clickEffect'none' | 'scale''none'Click effect style
shadow'none' | 'sm' | 'default' | 'lg''none'Shadow style
radius'none' | 'sm' | 'default' | 'lg' | 'full''full'Border radius
loadingbooleanfalseShows skeleton loading state
classNamestringAdditional CSS classes