Meter
Measure a current value within a known range.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/meterComplete the one-time setup first. Registry JSON lists source files and dependencies.
Usage
import { Meter } from "@/siteplane/components/meter";
<Meter value={40} aria-label="Storage used" />;Composition
Meter
├── MeterLabel
├── MeterValue
└── MeterTrack
└── MeterIndicatorSupplying children replaces the automatic track. Include MeterTrack and MeterIndicator explicitly, as in the first example.
Range and formatting
Values and formatting belong to the root. This example counts gigabytes instead of percentages and adds the total to the displayed value.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
Meter. | sm | md | lg | xl | provider / lg | Root size inherited by Label, Track and Value. |
Meter. | accent | success | warning | error | accent | Colors the filled part, for example by strength. accent keeps the progress fill. The earlier names default and destructive still work as deprecated aliases of accent and error. |
Meter. | string | en-US | Explicit kit formatting default; not automatically the locale provider. |
Meter. | ReactNode | Track with Indicator | Custom children replace the automatic track. |
Label / Track / Value. | sm | md | lg | xl | root / provider / lg | Override the part size. |
MeterLabel associates the visible label; MeterTrack contains MeterIndicator; MeterValue formats the current root value; a function child receives the formatted and the raw value. Indicator has no owned props. All styled parts accept string className. Root receives value, min, max, format and accessibility labels from Base UI Meter; those numerical and formatting contracts are inherited, not separate Siteplane UI APIs.
MeterProps, MeterLabelProps, MeterTrackProps and MeterValueProps export these same size extensions; MeterProps adds tone: MeterTone holds the four current values, and MeterDeprecatedTone the two earlier names. MeterPrimitive is the foundation namespace.
Usage notes
Use Progress for task completion; Meter describes a measurement such as capacity or usage. It does not support an unknown/loading state. Without MeterLabel, give the meter an aria-label, as in Usage.
At its minimum a meter is empty and shows no fill. Any value above the minimum shows at least a short fill, so a small value stays visible. The fill glides to a new value, and a new tone fades in with it.