Meter
A passive gauge for displaying a scalar measurement within a known range.
Displays a scalar measurement within a known numeric range along with optional threshold classification.
Preview
Section titled “Preview” Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Import meterRoot, meterLabel, meterTrack, meterIndicator, and meterValue from @proto.ui/prototypes-base/meter.
Compose Root, Label, Track, Indicator, and Value:
- Composition roles:
Rootmanages the numeric range;Labelnames the meter,TrackcontainsIndicator, andValuedisplaysvalueTextor the formatted numeric value. - Clamping and thresholds:
valueclamps to ordered finite[min, max]bounds (an equalminandmaxyields0percentage). Optionallow,high, andoptimumclassifystatusasoptimal,suboptimal, orcriticalwithout altering the underlying number. - Passive readout: Meter is display-only with no keyboard tab stop or editing events. Updating props synchronizes every part.
Rootand its parts exposevalue,percentage,indeterminate, andstatus.
| Prop | Type | Default |
|---|---|---|
value | number | undefined |
min | number | 0 |
max | number | 100 |
ariaLabel | string | '' |
valueText | string | '' |
low | number | undefined |
high | number | undefined |
optimum | number | undefined |
Label, Track, Indicator, and Value take no props.