Display
Meter
A value within a known range — a quota, a storage, a score — on the track family, its tone a palette class.
npx shadcn@latest add @fragiola/meterNo colour variants. The colour is the palette class the element carries: the
palettes row above changes nothing but className="palette-*". A new colour is a
new palette (Writing a palette) — the component never
changes.
A meter shows where a value sits in a known range: storage against a quota, seats against a plan,
a score. It is the meter role, not a task's progress (that is Progress).
value, min and max place it, and format writes its value for the locale.
The track family
Meter, Progress and Slider share the track family: track.rail (the rail, line) and
track.fill (the fill, ring, the colour of every "on" mark). The fill grows from the inline
start and inverts under RTL. The label is a field label and the value secondary text, beside it.
Bases
Both bases' Meter have the same parts and behave the same.
Parts
| Part | Source |
|---|---|
Root | primitive Meter.Root |
Label | field.label() |
Value | secondary text |
Track | track.rail() |
Indicator | track.fill() |