KPI
dashboardblocks/kpiFreeComponent
A flexible KPI card with trend indicators, sparklines, and progress tracking.
Live preview
live · rendered by the registry
Rendered by dashboardblocks on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://dashboardblocks.com/r/kpi.jsonSource
1'use client'23import { AnimatedNumber } from '@/registry/components/dashboardblocks/animated-number'4import { ComponentProps } from 'react'56import { Card, CardContent } from '@/components/ui/card'78import { cn } from '@/lib/utils'910export const KPI = (props: ComponentProps<typeof Card>) => {11 return <Card {...props} />12}1314export const KPIContent = (props: ComponentProps<typeof CardContent>) => {15 return (16 <CardContent17 {...props}18 className={cn('flex flex-col flex-1 justify-between', props.className)}19 />20 )21}2223interface KPIValueProps {24 animated?: boolean25 className?: string26 formatter?: (value: number) => string27 value: number28}2930const defaultFormatter = (value: number): string => value.toLocaleString()3132export const KPIValue = ({33 animated = false,34 className = '',35 formatter = defaultFormatter,36 value,37}: KPIValueProps) => {38 const displayValue = animated ? (39 <AnimatedNumber value={value} formatter={formatter} />40 ) : (41 formatter(value)42 )4344 return <div className={`text-3xl font-bold ${className}`}>{displayValue}</div>45}4647export type { KPIValueProps }
What it pulls in
Other registry items
Files it writes
More from dashboardblocks
All 36 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Feedactivity-feed | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-01activity-feed-01 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-02activity-feed-02 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-03activity-feed-03 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-04activity-feed-04 | dashboardblocks | Components | Free | 1 dep | |
| activity-feed-05activity-feed-05 | dashboardblocks | Components | Free | 1 dep | |
| Animated Numberanimated-number | dashboardblocks | Components | Free | no deps | |
| Animated Waveanimated-wave | dashboardblocks | Components | Free | no deps |
