Skip to content
Feedback

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">

PropTypeDefaultDescription
value*
numberCurrent usage.
max*
numberThe quota / limit the usage is measured against.
label
ReactNodeOptional label shown beside (linear) or below (circular) the meter.
unit
stringUnit 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) => stringOverride the `value / max` readout.
showValue
booleantrueWhether to render the textual value/percentage readout.
size
number96Diameter of the ring in px (circular variant only).