progress-kpi-03
dashboardblocks/progress-kpi-03FreeComponent
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-03.jsonSource
1'use client'23import { AnimatedNumber } from '@/registry/components/dashboardblocks/animated-number'4import { KPI, KPIContent, KPIValue } from '@/registry/components/dashboardblocks/kpi'5import { Ring } from '@/registry/components/dashboardblocks/ring'67import { CardDescription, CardTitle } from '@/components/ui/card'89interface ProgressKPI3Props {10 current: number11 goal: number12 title: string13 unit: string14}1516const exampleProps: ProgressKPI3Props = {17 current: 7500,18 goal: 10000,19 title: 'Monthly Goal',20 unit: 'sales',21}2223const ProgressKPI3 = (props: ProgressKPI3Props) => {24 const { current, goal, title, unit } = props25 const percentage = Math.min(100, Math.max(0, (current / goal) * 100))2627 return (28 <KPI>29 <KPIContent>30 <div className='grid grid-cols-2 gap-4'>31 <div className='flex items-center justify-between'>32 <div className='space-y-4'>33 <CardTitle>{title}</CardTitle>34 <div className='space-y-1'>35 <KPIValue className='text-2xl' value={current} animated />36 <CardDescription>37 of {goal.toLocaleString()} {unit}38 </CardDescription>39 </div>40 </div>41 </div>42 <div className='flex items-center justify-center'>43 <Ring44 className='h-24 w-24 sm:h-36 sm:w-36 shrink-0'45 percentage={percentage}46 ringColor='var(--color-chart-1)'47 >48 <AnimatedNumber49 className='text-lg font-bold'50 value={percentage}51 formatter={(value) => `${value.toLocaleString()}%`}52 />53 </Ring>54 </div>55 </div>56 </KPIContent>57 </KPI>58 )59}6061export { ProgressKPI3, exampleProps as progressKpi3ExampleProps, type ProgressKPI3Props }
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 |
