Meter
How far along or how full something is, from 0 to 100, as a bar, a ring, or a half ring, with optional red, amber, and green zones.
Plan usage or AI credits against a limit: total, usage by category, daily bars toned against the cap, and a warning near the limit. Composes kit Meter, UsageList, BarChart and Alert.
Plan usage and AI credits. Built from Meter, UsageList and BarChart.
Near the limit: the Meter turns warning, an Alert says what is left and Upgrade is the primary. Variants shows normal, limit reached and over limit.
9,240/ 10,000 credits
today 968 · cap 1,000 a day · 4 days near the cap
760 credits left
At this pace you hit the limit in ~2 days.
UsageMeter composes kit Meter (total), UsageList (by category), BarChart (daily, toned near and over the cap) and Alert (near limit). Upgrade becomes the solid primary only near or over the limit.
import { UsageMeter } from "agentic-ds-kit";From contracts/usagemeter.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| title | string | Yes | — | — |
| used | number | Yes | — | — |
| limit | number | Yes | — | — |
| unit | string | No | credits | — |
| categories | array | No | — | { id, label, value }[] listed with a kit UsageList against the limit. |
| periodStart | string | No | — | — |
| resetLabel | string | No | — | — |
| daily | number[] | No | — | Kit BarChart, one bar a day. |
| dailyLabels | string[] | No | — | — |
| dailyCap | number | No | — | Days from warnAt of the cap take status.warningBorder, days over it status.dangerBorder; the chart note says the cap and counts them. |
| warnAt | number | No | 0.8 | Same 80% threshold as UsageList. |
| paceNote | string | No | — | — |
| overage | object | No | — | { rateLabel, amount }, pre-formatted. Usage past the limit keeps running and is billed: the warning and the meter's name say the rate and the amount so far. |
| compact | boolean | No | false | One block for a settings page: title, badge and Upgrade on one line, then used of limit · reset · pace, the meter and categories in a row. No figure, axis, daily bars or Alert. Spans its container; under 40rem categories drop and Upgrade goes full width below the meter. |
| onUpgrade | function | No | — | Upgrade plan, the one solid primary; shown near or over the limit. |
| upgradeLabel | string | No | Upgrade plan | e.g. "Upgrade to Business". |
| onViewUsage | function | No | — | View usage (outline). |
| loading | boolean | No | false | — |
| error | string | No | — | — |
| onRetry | function | No | — | — |
How far along or how full something is, from 0 to 100, as a bar, a ring, or a half ring, with optional red, amber, and green zones.
A list of usage limits, one a row: the limit's name, how much is used of it, a bar, and a short note.
How full the prompt context is and what uses the space, by segment, with a warning near the limit, Trim oldest and compaction with Undo.
Inline status banner that stays on the page.