progress-kpi-02
dashboardblocks/progress-kpi-02FreeComponent
dashboardblocks publishes no description for this item.
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/progress-kpi-02.jsonSource
1'use client'23import { AnimatedNumber } from '@/registry/components/dashboardblocks/animated-number'4import { Icon } from '@/registry/components/dashboardblocks/icon'5import { KPI, KPIContent, KPIValue } from '@/registry/components/dashboardblocks/kpi'6import { ProgressBar } from '@/registry/components/dashboardblocks/progress-bar'7import { ClipboardList } from 'lucide-react'89import { CardTitle } from '@/components/ui/card'1011interface ProgressKPIBar {12 label: string13 target: string14 percentage: number15 fillClassName?: string16 trackClassName?: string17}1819interface ProgressKPI2Props {20 title: string21 value: number22 progressBars: ProgressKPIBar[]23}2425const exampleProps: ProgressKPI2Props = {26 title: 'Task Completion',27 value: 87,28 progressBars: [29 {30 label: 'completed',31 target: '51 tasks',32 percentage: 59,33 fillClassName: 'bg-green-600',34 },35 {36 label: 'in progress',37 target: '26 tasks',38 percentage: 30,39 fillClassName: 'bg-blue-600',40 },41 {42 label: 'not started',43 target: '10 tasks',44 percentage: 11,45 fillClassName: 'bg-red-600',46 },47 ],48}4950const ProgressKPI2 = (props: ProgressKPI2Props) => {51 const { title, value, progressBars } = props52 return (53 <KPI>54 <KPIContent className='space-y-1'>55 <div className='flex items-center justify-between'>56 <CardTitle>{title}</CardTitle>57 <Icon icon={ClipboardList} variant='secondary' />58 </div>59 <KPIValue60 value={value}61 formatter={(value) => `${value.toLocaleString()}/100`}62 animated63 />64 <div className='mt-5 space-y-3'>65 {progressBars.map((bar) => {66 const safePercentage = Number.isFinite(bar.percentage) ? bar.percentage : 067 const normalized = Math.min(100, Math.max(0, safePercentage))6869 return (70 <div key={bar.label} className='space-y-1.5 text-sm text-muted-foreground'>71 <div className='flex items-center justify-between'>72 <span>73 <span className='font-semibold text-foreground'>74 <AnimatedNumber75 value={normalized}76 formatter={(value) => `${value.toLocaleString()}%`}77 />78 </span>{' '}79 {bar.label}80 </span>81 <span className='font-semibold text-foreground'>{bar.target}</span>82// … truncated
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 |
