Meter
A measured amount within a known range (role="meter") — not task progress.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A measured amount within a known range (role="meter") — not task progress.
Accessibility
Status messages use role="status" / aria-live="polite" (or assertive for errors) so updates are announced without stealing focus.
Install and import
npx shadcn@latest add @prism/meter
import { Meter } from '@/components/prism/Meter';
In a no-build prototype, read it from the bundle instead: const { Meter } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
value | number | Yes | The measured amount. |
min | number | — | Bottom of the range. Default 0. |
max | number | — | Top of the range. Default 100. |
label | React.ReactNode | — | What's measured. A string also names the meter for screen readers (else pass aria-label). |
valueLabel | React.ReactNode | — | Replaces the shown value text, e.g. "14 of 20 beds". |
showValue | boolean | — | Show the value beside the label. Default true. |
tone | "accent" | "positive" | "notice" | "negative" | "neutral" | — | |
formatValue | (value: number) => string | — | Formats the shown value, e.g. (v) => ${v} MB. Default: percent of the range. |
className | string | — |