Usage Meter
Linear or circular quota / billing usage indicator with severity tones.
Import
tsx
import { UsageMeter, UsageMeterLinear, UsageMeterCircular } from "@cooud-ui/ui";
bash
npx cooud-ui add usage-meter
Examples
API Reference
Generated from the component's exported types.
UsageMeterProps
Extends Omit<HTMLAttributes<HTMLDivElement>, "children">
| Prop | Type | Default | Description |
|---|---|---|---|
value* | number | — | Current usage. |
max* | number | — | The quota / limit the usage is measured against. |
label | ReactNode | — | Optional label shown beside (linear) or below (circular) the meter. |
unit | string | — | Unit suffix appended to the value readout, e.g. "tokens". |
variant | UsageMeterVariant | "linear" | Layout: a horizontal bar or an SVG ring. |
tone | UsageMeterTone | "auto" | Color. `auto` derives severity from the usage ratio; others are explicit. |
formatValue | (value: number, max: number) => string | — | Override the `value / max` readout. |
showValue | boolean | true | Whether to render the textual value/percentage readout. |
size | number | 96 | Diameter of the ring in px (circular variant only). |