{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "usage-meter",
  "type": "registry:ui",
  "title": "Usage meter",
  "description": "Single usage meter with a label, used over limit count and a Progress bar linked by aria-labelledby. Handy for API calls, storage or seats on billing pages.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.minidev.pro/r/progress.json",
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/usage-meter.tsx",
      "type": "registry:ui",
      "target": "components/ui/usage-meter.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { Progress } from \"@/components/ui/progress\"\n\nfunction UsageMeter({\n  label,\n  used,\n  limit,\n  className,\n}: {\n  label: string\n  used: number\n  limit: number\n  className?: string\n}) {\n  const id = React.useId()\n  const pct = Math.min(100, Math.round((used / limit) * 100))\n  return (\n    <div data-slot=\"usage-meter\" className={cn(\"space-y-1.5\", className)}>\n      <div className=\"flex justify-between text-xs\">\n        <span className=\"text-fg\" id={id}>{label}</span>\n        <span className=\"tabular-nums text-fg-muted\">{used}/{limit}</span>\n      </div>\n      <Progress value={pct} aria-labelledby={id} />\n    </div>\n  )\n}\nexport { UsageMeter }\n"
    }
  ]
}
