usage-meter-06
dashboardblocks/usage-meter-06FreeComponent
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-06.jsonSource
1'use client'2import { AnimatedNumber } from '@/registry/components/dashboardblocks/animated-number'3import { Icon } from '@/registry/components/dashboardblocks/icon'4import { ProgressBar } from '@/registry/components/dashboardblocks/progress-bar'5import { Crown, Database, Mail, Users, Zap } from 'lucide-react'6import type { LucideIcon } from 'lucide-react'78import { Button } from '@/components/ui/button'9import { Card, CardContent, CardFooter, CardTitle } from '@/components/ui/card'1011interface PlanLimit {12 icon: LucideIcon13 limit: number14 name: string15 used: number16}1718interface UsageMeter6Props {19 limits: PlanLimit[]20 plan: string21}2223const exampleProps: UsageMeter6Props = {24 limits: [25 { name: 'Team members', used: 4, limit: 5, icon: Users },26 { name: 'API calls', used: 8500, limit: 10000, icon: Zap },27 { name: 'Storage', used: 4.9, limit: 5, icon: Database },28 { name: 'Emails sent', used: 450, limit: 1000, icon: Mail },29 ],30 plan: 'Pro',31}3233const UsageMeter6 = (props: UsageMeter6Props) => {34 const { limits, plan } = props35 return (36 <Card>37 <CardContent className='space-y-6'>38 <div className='flex items-center gap-2'>39 <Icon icon={Crown} size='md' />40 <CardTitle className='text-base font-medium'>{plan} Plan</CardTitle>41 </div>42 <div className='space-y-3'>43 {limits.map((item) => {44 const percentage = (item.used / item.limit) * 10045 const safePercentage = Number.isFinite(percentage) ? percentage : 046 const normalized = Math.min(100, Math.max(0, safePercentage))47 const fillClassName =48 normalized >= 9549 ? 'bg-destructive'50 : normalized >= 8051 ? 'bg-amber-500'52 : 'bg-emerald-500'53 const formattedLimit =54 item.limit >= 100055 ? `${(item.limit / 1000).toFixed(0)}k`56 : item.limit.toString()5758 return (59 <div key={item.name} className='space-y-1'>60 <div className='flex items-end justify-between text-sm'>61 <div className='flex items-center gap-2'>62 <item.icon className='h-3.5 w-3.5' />63 <span>{item.name}</span>64 </div>65 <span className='text-xs text-muted-foreground'>66 <AnimatedNumber67 value={item.used}68// … 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 |
