Primitives
A meter is a visual representation of a value within a range.
Import the Meter primitives from ng-primitives/meter.
import {
NgpMeter,
NgpMeterValue,
NgpMeterIndicator,
NgpMeterTrack,
NgpMeterLabel,
} from 'ng-primitives/meter';
Assemble the meter directives in your template.
<div ngpMeter>
<span ngpMeterLabel>Label</span>
<span ngpMeterValue>Value</span>
<div ngpMeterTrack>
<div ngpMeterIndicator></div>
</div>
</div>
Create a reusable component that uses the NgpMeter directive.
Generate a reusable meter component using the Angular CLI.
ng g ng-primitives:primitive meter
path: The path at which to create the component file.prefix: The prefix to apply to the generated component selector.componentSuffix: The suffix to apply to the generated component class name.fileSuffix: The suffix to apply to the generated component file name. Defaults to component.exampleStyles: Whether to include example styles in the generated component file. Defaults to true.The following directives are available to import from the ng-primitives/meter package:
The value of the meter.
The minimum value of the meter.
The maximum value of the meter.
Define a function that returns the meter value label.
[ngpMeter]ngpMeter
[ngpMeterLabel]ngpMeterLabel
[ngpMeterValue]ngpMeterValue
[ngpMeterTrack]ngpMeterTrack
[ngpMeterIndicator]ngpMeterIndicator
Adheres to the Meter Accessibility guidelines.
Copyright © 2025 Angular Primitives