usage-meter-07
dashboardblocks/usage-meter-07FreeComponent
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/usage-meter-07.jsonSource
1'use client'2import { AnimatedNumber } from '@/registry/components/dashboardblocks/animated-number'3import { AnimatedWave } from '@/registry/components/dashboardblocks/animated-wave'4import { Icon } from '@/registry/components/dashboardblocks/icon'5import { Database, LucideIcon } from 'lucide-react'67import { Button } from '@/components/ui/button'8import { Card, CardHeader, CardTitle } from '@/components/ui/card'910interface UsageMeter7Props {11 icon: LucideIcon12 limit: number13 onUpgrade?: () => void14 title: string15 unit: string16 used: number17}1819const exampleProps: UsageMeter7Props = {20 icon: Database,21 limit: 1500,22 title: 'Storage',23 unit: 'MB',24 used: 430,25}2627const UsageMeter7 = (props: UsageMeter7Props) => {28 const { icon: IconComponent, limit, onUpgrade, title, unit, used } = props29 const remaining = limit - used3031 return (32 <Card className='overflow-hidden pb-0'>33 <CardHeader className='flex items-center justify-between'>34 <div className='flex items-center gap-2'>35 <Icon icon={IconComponent} size='sm' />36 <CardTitle>{title}</CardTitle>37 </div>38 {onUpgrade && (39 <Button variant='outline' size='sm' onClick={onUpgrade}>40 Upgrade41 </Button>42 )}43 </CardHeader>44 <div className='relative h-[150px]'>45 <AnimatedWave percentage={100} />46 <div className='absolute inset-0 z-10 flex flex-col items-center justify-center space-y-3 text-center text-primary-foreground'>47 <div className='space-y-1'>48 <div className='text-sm font-medium tracking-wider'>REMAINING</div>49 <div className='flex items-start gap-1 text-4xl font-bold leading-none'>50 <AnimatedNumber51 value={remaining}52 formatter={(value) => value.toLocaleString()}53 />54 <span className='text-sm font-medium'>{unit}</span>55 </div>56 </div>57 <div className='text-sm'>58 <AnimatedNumber value={used} formatter={(value) => value.toLocaleString()} />{' '}59 {unit} / {limit} {unit} used60 </div>61 </div>62 </div>63 </Card>64 )65}6667export { UsageMeter7, exampleProps as usageMeter7ExampleProps, type UsageMeter7Props }
What it pulls in
npm packages
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 |
