This page as markdown: /meter.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

Meter

Status: stable

A role=meter reading over Base UI Meter, drawn as a bar or a ring — how full something is within a known range (storage, quota, strength), with a tone for good/caution/bad. Not task progress.

Keywords: meter, usage bar, storage, quota, capacity, limit, password strength, level, segmented, tick bar, score, credits, spend limit

Usage

Use Meter to show a static measurement against a known maximum — storage used, seats taken, API quota, password strength. It is announced as a meter, not a progress bar, so a screen-reader user hears a level rather than a task underway.

Best practices

Anatomy

Part Required Description
MeterTrack yes The rail that represents the full range.
MeterIndicator yes The fill, sized from value and coloured by tone. Not used with segments: the track draws its ticks instead.
MeterLabel no The visible name; also names the meter for assistive tech.
MeterValue no The formatted reading.

Subcomponents

Name Type Description
MeterTrack Base UI Track props + className + size The rail. Rendered automatically when Meter has no children; renders a MeterIndicator by default — or, when the Meter has segments, its row of ticks (children are not rendered then).
MeterIndicator Base UI Indicator props + className + tone The fill. Inherits the Meter's tone unless given its own.
MeterLabel Base UI Label props + className Visible label; wires aria-labelledby on the root.
MeterValue Base UI Value props + className Formatted reading. Accepts a (formatted, value) => ReactNode child.

Props

Name Type Default Description
value number — The current reading, between min and max. Required.
min number 0 The bottom of the range.
max number 100 The top of the range.
tone "primary" | "3" | "success" | "warning" | "destructive" "primary" Fill colour, mapped to a semantic token. Choose it from your own thresholds.
shape "bar" | "ring" "bar" bar is a horizontal track; ring is a circular gauge for a small, glanceable reading — the same value, min, max and tones.
size "sm" | "md" | "lg" "md" Ring diameter (40 / 64 / 96px at the default spacing; the centre value steps with it), or bar thickness on the same sm / md / lg rails as Progress.
showValue boolean — Print the value in the ring's centre (formatted like MeterValue).
segments number — Draw the bar as this many separate ticks instead of a continuous fill (a quota, score or spend limit). Filled ticks = round(share × N), at least one for any reading above min, none at min. Ticks take the tone; empty ones sit on the rail colour. The segmented track has its own, taller sm / md / lg ladder. Bar only: ignored for shape="ring".
strokeWidth number 6 Ring stroke width, in viewBox units of 100.
format Intl.NumberFormatOptions — Formatting for MeterValue and aria-valuetext (percent, unit, currency).
getAriaValueText (formatted: string, value: number) => string — Human-readable reading for assistive tech ("7.2 of 10 gigabytes used").
locale Intl.LocalesArgument — Locale for formatting. Defaults to the runtime locale.

Variants

Tokens used

secondary, primary, tone-3, success, tone-warning, destructive, foreground, muted-foreground, destructive-mark, success-mark, tone-warning-mark, tone-3-mark

Motion

Accessibility

Related

Examples

Ring

import { Meter } from "@sableui/react"

<Meter shape="ring" value={72} showValue aria-label="Storage used" />

Bare

import { Meter } from "@sableui/react"

<Meter value={64} aria-label="Storage used" />

Storage with label and reading

import { Meter, MeterLabel, MeterTrack, MeterValue } from "@sableui/react"

<Meter value={7.2} max={10} tone="warning" getAriaValueText={(_, v) => `${v} of 10 gigabytes used`}>
	<div className="mb-2 flex flex-wrap items-center justify-between gap-x-3 gap-y-1">
		<MeterLabel>Storage</MeterLabel>
		<MeterValue>{(_, value) => `${value} of 10 GB`}</MeterValue>
	</div>
	<MeterTrack />
</Meter>

Segmented spend limit

import { Meter, MeterLabel, MeterTrack, MeterValue } from "@sableui/react"

<Meter value={1240} max={2000} segments={40} getAriaValueText={() => "€1,240 of €2,000 spent this month"}>
	<div className="mb-2 flex flex-wrap items-center justify-between gap-x-3 gap-y-1">
		<MeterLabel>Monthly spend limit</MeterLabel>
		<MeterValue>{() => "€1,240 / €2,000"}</MeterValue>
	</div>
	<MeterTrack />
</Meter>

Segmented score cell

import { Meter } from "@sableui/react"

<div className="flex items-center gap-3">
	<Meter value={8} max={10} segments={10} size="sm" tone="success" className="w-24" aria-label="ICP score" getAriaValueText={(_, v) => `${v} out of 10`} />
	<span className="text-mono-caption text-foreground">8/10</span>
</div>

Tones

import { Meter } from "@sableui/react"

<div className="flex flex-col gap-3">
	<Meter value={30} tone="success" aria-label="Seats used" />
	<Meter value={82} tone="warning" aria-label="API quota used" />
	<Meter value={100} tone="destructive" aria-label="Storage used" />
</div>