Skip to content
GitHub (opens in a new tab)

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.

stableAtomcontracts/meter.json

Preview

Meter

How far along or how full something is, 0 to 100, as a bar, ring, or half ring, with optional zones. Not Progress. Not UsageList. Not MeterCircle.

Master

Budget at 60 on a medium bar with its value. Variants shows thresholds, reference lines and the ring shapes.

Usage

Simple determinate completion without zones stays Progress. Zones, datatip, and indeterminate belong here.

Do's

  • Task completion with a known percent: uploads, imports, onboarding — when you need zones, a datatip, or indeterminate
  • A measure against a range, like storage, budget, or a score, where red, amber, and green zones help people judge it
  • A color the screen decides, like a usage limit going amber and red: set intent

Don'ts

  • Simple determinate task completion without zones — use Progress
  • Usage against a plan limit as labeled rows — use UsageList
  • A short wait of unknown length in the spot that is loading — use Spinner
  • Placeholder layout while data arrives — use Skeleton
  • Part-to-whole share across segments — use PieChart
<Meter
  label="Budget spent"
  value={60}
  showValue
/>

When to use

  • Task completion with a known percent: uploads, imports, onboarding — when you need zones, a datatip, or indeterminate
  • A measure against a range, like storage, budget, or a score, where red, amber, and green zones help people judge it
  • A color the screen decides, like a usage limit going amber and red: set intent

When not to use

  • Simple determinate task completion without zones — use Progress
  • Usage against a plan limit as labeled rows — use UsageList
  • A short wait of unknown length in the spot that is loading — use Spinner
  • Placeholder layout while data arrives — use Skeleton
  • Part-to-whole share across segments — use PieChart

What an agent reads

import { Meter } from "agentic-ds-kit";
must
  • role=progressbar with aria-valuemin 0 and aria-valuemax 100, named by label
  • aria-valuetext is the percent, followed by the datatip when there is one
  • indeterminate leaves out aria-valuenow and aria-valuetext, so screen readers hear it is busy, with no number
  • The indeterminate segment stops sliding when the person prefers reduced motion; the bar shows a still, faint fill
  • The drawing is decorative; the percent and datatip text are hidden from screen readers because the progressbar already reads them
  • The bar fill slides to its value with a transform on the enter timing; the track clips it. No motion under prefers-reduced-motion
defaults
  • label Progress
  • shape bar
  • size md
  • thresholds none
  • referenceLines false
  • showValue false
stops if
  • Do not use it for a short wait of unknown length in the spot that is loading — show a Spinner
  • Do not use indeterminate with circle or semicircle; it is bar only
  • Do not draw bars or rings from divs or SVG — use Meter or Progress
  • Do not add a MeterLabel, MeterCircle, or ProgressCircle — pick shape
  • Do not use intent and thresholds bar together — intent wins; pick one
  • Do not rely on the zone colors alone; say what the value means in the label, showValue, or datatip
  • Do not use Meter for simple determinate completion without zones — use Progress
  • Do not skip prefers-reduced-motion on the indeterminate slide
  • Do not use raw hex or primitive --color-* ramps

From contracts/meter.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
valuenumber | "indeterminate"Yes—0 to 100. Values outside are clamped. indeterminate is for work whose amount done is not known: a short segment slides along a bar, with no percent. Bar only.
labelstringNoProgressNames it for screen readers, like Storage used.
shapebar | circle | semicircleNobarbar fills its container's width. circle is a ring that fills clockwise from the top. semicircle is a bowl: 0 to 100 runs from its left tip, under, to its right tip.
sizesm | md | lgNomdBar: space-1 / space-2 / space-3 tall. Circle and semicircle: 56 / 96 / 196 wide.
thresholdsnone | bar | plotArea | allNononeZones are thirds: under 33 is red, under 67 amber, the rest green. none: brand (ink) value on a muted track. bar: the value takes its zone's color. plotArea: the track takes the value's zone color under a brand value. all: the track shows all three bands under a brand value.
intentenumNo—Sets the value's color outright, whatever thresholds says, when the screen knows what the value means. neutral is a mid grey for a value that carries no judgement. Leave it out for the brand (ink) value or the threshold zones. info | success | warning | danger | neutral
referenceLinesbooleanNofalseMarks at the zone edges, a third and two thirds along.
showValuebooleanNofalseThe rounded percent: after the bar, or inside the ring.
datatipstringNo—A short note in a tip at the end of the value, like $6,000 of $10,000.
  • Component
    →

    Progress

    Task completion as a bar or circle from 0 to 100, or an indeterminate bar when the percent is not known.

  • Component
    →

    UsageList

    A list of usage limits, one a row: the limit's name, how much is used of it, a bar, and a short note.

  • Component
    →

    Spinner

    Spinning circular loader for short indeterminate waits.

  • Component
    →

    Skeleton

    Gray placeholder shapes in the layout of content that is still loading, like lines of text, an avatar, or an image, or a whole table, card, or list layout, so the page keeps its shape until the data arrives.