Display

Meter Group

Stacked-segment progress bar. Each segment is sized proportionally to its value relative to the sum (or the explicit max); legend listed underneath.

Installation

import { WrMeterGroup } from 'ngwr/meter-group';

@Component({ imports: [WrMeterGroup] })
export class MyComponent {}

Disk usage

<wr-meter-group
  [segments]="[
    { label: 'Used', value: 60 },
    { label: 'Reserved', value: 25, color: 'var(--wr-color-warning)' }
  ]"
  [max]="100"
/>
  • System32
  • Apps88
  • Documents24
  • Free112

Types

Data shapes used by the inputs and outputs above.

interface WrMeterSegment {
  label: string;
  value: number;
  color?: string;
}
NameDescriptionTypeDefault
WrMeterSegmentOne segment of the bar.interface
labelrequiredLabel shown in the legend.string
valuerequiredPortion of the sum of all segments.number
colorCSS color for the slice and legend swatch.stringpalette

API

NameDescriptionTypeDefault
ariaLabelAccessible name — the role needs one. Falls back to meterGroup.label.string | nullnull
segmentsreadonly WrMeterSegment[][]
maxExplicit total. When 0 (default), max = sum(values).number0
showLegendShow the labelled legend under the bar.booleantrue
showValuesShow each segment's value in the legend, next to its label.booleantrue

WrMeterSegment

NameDescriptionTypeDefault
labelLegend label.string
valueSlice size — proportional to total.number
colorCSS color (any value). Falls through to a rotating palette of theme tokens when omitted.stringauto