1 variant
Usage Meter
A segmented usage bar with a live total and an upgrade prompt once a limit is close.
API calls this month7,100 / 10,000
Chat4,200Embeddings2,100Vision800
import { UsageMeter } from "@/components/registry/usage-meter";
export function ApiUsage() {
return (
<UsageMeter
label="API calls this month"
limit={10000}
categories={[
{ label: "Chat", value: 4200 },
{ label: "Embeddings", value: 2100 },
]}
/>
);
}113 more lines ship with an easeUI Pro license.
Buy a licenseInstall
$ bunx --bun shadcn add @easeui-pro/usage-meter
Props
UsageMeter
labelRequiredstringSits above the bar and names the progressbar for screen readers.
categoriesRequiredUsageCategory[]One segment and one legend entry each.
limitRequirednumberWhat the bar is measured against.
warnAtnumberDefault 0.8Fraction of the limit that turns on the warning.
upgradeHrefstringWhere Upgrade goes. Without it the warning still shows, just as plain text rather than a link to nowhere.
classNamestringMerged last, so anything passed here wins over the component's own classes.
UsageCategory
labelRequiredstringShown in the legend under the bar.
valueRequirednumberPrinted beside the label, so the number is never hidden behind a hover.
tone"accent" | "violet" | "neon" | "warning"Default cycles the accentsSegment color.