Skip to content
caliper ui pro docs

Usage meter

A segmented bar showing how an allowance is used, with a warning near the limit.

Pro

API requests · day 9 of 31

742 / 1,000 k

At this pace you reach about 2.56M by 31 Oct: roughly $78 extra.

Free

Within limit

When to use

  • Storage, seats and quota shown as parts of a whole.
  • You want a visible warning as the limit nears.

When not to use

  • There is no limit; use a metric.
  • Only one value matters; use a progress bar.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/usage-meter

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

UsageMeter

11 props
PropTypeDefaultDescription
label *string—
segments *readonly UsageSegment[]—
limit *number—
unitstring""
freeLabelstring"Free"
overLabelstring"Over limit"
warnAtnumber0.9
projectednumber—Projected total at the end of the period, drawn dashed beyond what is used.
consequencestring—What the numbers mean, e.g. "About $78 extra at this pace."
legendbooleantrueThe segment buttons and status word under the bar. Turn off for a single plain count.
classNamestring—

Keyboard

→
Moves to the next item or value.
↓
Moves to the next item or value.
←
Moves to the previous item or value.
↑
Moves to the previous item or value.
Home
Jumps to the first item or the minimum.
End
Jumps to the last item or the maximum.

Accessibility

It exposes group and img semantics, with aria-label, aria-pressed and aria-live kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/usage-meter.md

The index of every part is at /llms.txt.

More in Status