Skip to content
pandacoderz/ui

Usage Meter

Labelled progress meter for context windows, rate limits, and budgets, with warning and danger thresholds.

Context window41.2K / 200K(21%)
Requests per minute860 / 1K(86%)
Monthly budget$97.40 / $100(97%)

Installation

npx shadcn@latest add https://ui.spencerwueste.com/r/usage-meter.json

Usage

import { UsageMeter, UsageMeterGroup } from "@/components/pandacoderz-ui/usage-meter";
<UsageMeter label="Context window" value={41_200} max={200_000} showPercent />
<UsageMeter label="Budget" value={97.4} max={100} format={(v, m) => `$${v} / $${m}`} />

The bar turns amber at warnAt percent and red at dangerAt percent.

API Reference

Prop Type Description
value / max number Current and maximum.
label ReactNode Left-hand label.
format (value, max) => string Right-hand text. Defaults to compact numbers.
showPercent boolean Appends a percentage.
warnAt / dangerAt number Thresholds in percent. Defaults 80 and 95.
size "sm" | "md" Bar thickness.