Meter

A bar that visualizes a value within a known range.

Basic

The scalar-measurement cousin of Progress: reach for meter when the value just sits at a level (storage used, score vs target) and for Progress when work is in motion. Wrap a .meter__bar in a .meter__track inside .meter. The root carries role="meter" + aria value attributes (use aria-valuetext when the unit matters). Add .meter__label / .meter__value to caption it.

Intents

Recolor the fill with an intent modifier on .meter__bar. Flip the intent at thresholds for a quick gauge.

Sizes

Default is a thin strip; --sm a hairline; --lg a label-friendly height for hero metrics.

Stacked

Drop multiple .meter__bar children into one track to break the value into segments. Widths must sum to ≤ 100%; remaining room exposes the track background.

Legend

Pair a stacked meter with a .meter__legend row. Each .meter__legend-dot reuses --meter-bar-bg, so the intent modifier (or an inline override) colors the swatch to match its bar.

Customization

These variables retune .meter. Override on the element, a parent scope, or :root.

VariableUse
--meter-heightTrack height; size modifiers reassign this
--meter-radiusTrack corner radius; pilled by default
--meter-header-gapSpace between the caption row and the track
--meter-segment-gapGap between adjacent bars in a stacked track
--meter-bgTrack background (unfilled portion)
--meter-bar-bgBar fill (intent modifiers retune; also drives the legend dot)
--meter-label-font-sizeCaption font size
--meter-label-colorLabel text color
--meter-value-colorValue text color
--meter-legend-row-gapSpace between the track and the legend
--meter-legend-item-gapHorizontal gap between legend items
--meter-legend-dot-sizeDiameter of the legend swatch
--meter-legend-font-sizeLegend text size
--meter-legend-colorLegend text color