Skip to content
ZikZuk UI

Meter

Stripe MeterChart

A whole divided into segments. As usage it is grey, turning orange at 70% and red at 90% of the limit, and reads “6,500 of 10,000 · 65%”. As composition it uses the brand scale, light to deep, to show where an amount sits. compact draws the bar alone for a table cell.

pnpm add @zikzuk/ui
import { Meter } from "@zikzuk/ui";

Usage

65%, 75% and 93% of the limit.

SMS this month6,500 of 10,000 · 65%
Andheri branch37,500 of 50,000 · 75%
  • Spent31,000
  • Held6,500
API calls today930 of 1,000 · 93%

Composition and compact

Where the money is₹5,00,000.00
  • Unallocated₹1,20,000.00
  • In branch pools₹2,30,000.00
  • In wallets₹1,50,000.00

When to use

  • A plan's quota, a branch's spend against its limit, an allocation.

Not for

  • Progress through steps — TaskList has its own progress header.
  • Trends over time — Sparkline or a chart.

Props

PropTypeDescription
segments{ label, value, color? }[]The parts. data is Stripe's name for it.
totalnumberThe limit (usage) or the whole (composition).
variant"usage" | "composition"
Default "usage"
How it is coloured and labelled.
labelReactNodeLeft of the value line; a string label also names a compact meter.
valueLabelReactNodeRight of the label; null hides it.
formatValue(n: number) => stringFormats every number shown.
showLegendboolean
Default true
The legend under the bar.
onSegmentClick(segment) => voidLegend items become buttons.
compactboolean
Default false
The bar alone.
aria-labelstringAccessible name without a visible label.
classNamestringExtra classes on the outer element.