On this page
@addTagHelper *, Webority.Ui.RazorA plain meter
With no thresholds the meter keeps the tone you pass, the same fallback fill as a progress bar.
Threshold auto-toning
Set low and high and the fill tones itself; optimum says whether bigger or smaller is the good end.
Disk usage
A usage meter with a warning and a danger line shows how close a resource is to its limit.
A visible label
Show the label above the bar when readers need the reading in words; it is always the accessible name.
Compact size
Use the thin size where a full-height bar would crowd a table row or an inline line.
Every option
Every value of every prop, one cell each.
value clamping: out-of-range input
value=-25, min=0, max=100 → clamped to 0%value=250, min=0, max=100 → clamped to 100%min and max: the range the value sits in
min="0" (default), value=62 → 62% of the barmin=50, value=75, max=100 → halfwaymax="100" (default), value=62 → 62% of the barmax=200, value=50 → a quarter of the bartone: fallback fill, no thresholds (all five)
tone="info" (default)
tone="success"
tone="warning"
tone="danger"
tone="neutral"
optimum: high (default), bigger is better, with low and high
optimum="high" (default), value=10, low=20, high=80 → below low → dangeroptimum="high" (default), value=20 (== low) → at-or-below low → dangeroptimum="high" (default), value=50 → between low and high → warningoptimum="high" (default), value=80 (== high) → at-or-above high → successoptimum="high" (default), value=90 → above high → successoptimum: low, smaller is better, with low and high
value=10, low=20, high=80, optimum="low" → below low → successvalue=20 (== low), optimum="low" → at-or-below low → successvalue=50, optimum="low" → between low and high → warningvalue=80 (== high), optimum="low" → at-or-above high → dangervalue=90, optimum="low" → above high → dangerlow and high: unset (default), so the tone you pass decides the fill
low and high unset (default)size
size="sm"
size="md" (default)
label / showLabel
(no label)label only (accessible name, not rendered), show-label off (default)label + show-label (rendered above the bar)show-label with a long label (wraps above the bar)className: extra classes on the component
class="demo-meter": extra classes on the component, no look of its own (React: className)Guidance
What to do, and what to avoid.
Use it when
- You have a single measurement within a known min…max range: disk used, a score, remaining quota.
- There are meaningful thresholds where the reading becomes concerning, and you want the colour to say so automatically.
- The value is a state to read at a glance, not a task advancing toward completion.
Reach for something else when
- The value is a task's completion moving toward 100% over time. → AppProgress
- A single headline number with an optional trend, not a bar. → AppKpiTile
- There is no known amount at all, it is just "working". → AppSpinner
Use meters for measurements, not tasks
Real thresholds that mean something operationally, so the auto-tone is trustworthy.
A task advancing toward completion is not a measurement: that is AppProgress, not AppMeter.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
10 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| valuedefault - | number | - | The measurement, from min to max. It is clamped into range. |
| mindefault 0 | number | 0 | The low end of the range. |
| maxdefault 100 | number | 100 | The high end of the range. |
| tonedefault info | info | success | warning | danger | neutral | info | The fill colour when no thresholds are set. |
| lowdefault - | number | - | A value at or below this is the low zone. |
Less common 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| optimumdefault high | high | low | high | Which end is good. High means bigger is better. |
| highdefault - | number | - | A value at or above this is the high zone. |
| sizedefault md | sm | md | md | The bar thickness. |
| labeldefault - | string | - | The accessible name of the bar. It is also shown above the bar when show-label is set. |
| show-labeldefault false | bool | false | Shows the label text above the bar. |
Screen reader
3 notes- The bar has role meter with aria-valuenow, aria-valuemin and aria-valuemax, so assistive technology reads the value within its range.
- label is the accessible name of the bar. The label shown above it is hidden from assistive technology so it is not read twice.
- The tone is a visual cue only and is not announced, so state the reading in label.
Do and avoid
1 pairsUse meters for measurements, not tasks
Real thresholds that mean something operationally, so the auto-tone is trustworthy.
A task advancing toward completion is not a measurement: that is AppProgress, not AppMeter.