Skip to main content

Stat Bullet

A horizontal bullet chart with actual value bar, target marker, and qualitative range zones for KPI-to-target tracking.

Installation

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

Component

Horizontal bullet charts with targets and different sizes.

Revenue

Goal: 90

Active Users

Target: 50K

Sales Volume

Goal: 180

Completion Rate

Based on last 30 days

Customer Satisfaction

Goal: 75%
NPS Score

Props

PropTypeDefaultDescription
value*numberCurrent/actual value
maxnumber100Scale maximum
label*stringLabel text
colorThemeColor'primary'Bar color
targetnumberTarget marker position
targetLabelstringLabel for target (e.g., 'Goal')
ranges{ value: number; color: ThemeColor; label?: string }[]Background qualitative range zones sorted ascending
showValuebooleantrueShow value text
formatValue(value: number, max: number) => stringCustom format function for displayed value
descriptionReactNodeAdditional description text
size'sm' | 'md' | 'lg''md'Bar height preset
variant'default' | 'gradient''default'Bar fill style
animatedbooleanfalseAnimate bar width on mount
glowbooleanfalseGlow effect on feature bar
animateValuebooleantrueNumber counting animation
loadingbooleanfalseShows skeleton loading state
cardPropsCardPropsProps to pass to the Card wrapper
classNamestringAdditional CSS classes