Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

A plain meter

With no thresholds the meter keeps the tone you pass, the same fallback fill as a progress bar.

No thresholds
Show code
<app-meter value="62" tone="Info" label="CPU load" show-label="true" />

Threshold auto-toning

Set low and high and the fill tones itself; optimum says whether bigger or smaller is the good end.

Bigger is better: optimum="high"
At or below low is danger, between is warning, at or above high is success.
Show code
<app-meter value="15" low="20" high="80" label="Below threshold" show-label="true" />
<app-meter value="50" low="20" high="80" label="Mid range" show-label="true" />
<app-meter value="90" low="20" high="80" label="Above threshold" show-label="true" />
Smaller is better: optimum="low"
The zones flip: at or below low is now success, at or above high is danger.
Show code
<app-meter value="15" low="20" high="80" optimum="Low" label="Low error rate" show-label="true" />
<app-meter value="50" low="20" high="80" optimum="Low" label="Mid error rate" show-label="true" />
<app-meter value="90" low="20" high="80" optimum="Low" label="High error rate" show-label="true" />

Disk usage

A usage meter with a warning and a danger line shows how close a resource is to its limit.

92 percent used
A warning line at 60% and a danger line at 90%.
Show code
<app-meter value="92" low="60" high="90" optimum="Low" label="Disk usage 92%" show-label="true" />

A visible label

Show the label above the bar when readers need the reading in words; it is always the accessible name.

label only vs showLabel
Show code
<app-meter value="40" tone="Neutral" label="Quota used" />
<app-meter value="40" tone="Neutral" label="Quota used" show-label="true" />

Compact size

Use the thin size where a full-height bar would crowd a table row or an inline line.

size="sm"
Show code
<app-meter value="70" size="Sm" tone="Success" label="Storage quota" />

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 bar
min=50, value=75, max=100 → halfway
max="100" (default), value=62 → 62% of the bar
max=200, value=50 → a quarter of the bar

tone: 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 → danger
optimum="high" (default), value=20 (== low) → at-or-below low → danger
optimum="high" (default), value=50 → between low and high → warning
optimum="high" (default), value=80 (== high) → at-or-above high → success
optimum="high" (default), value=90 → above high → success

optimum: low, smaller is better, with low and high

value=10, low=20, high=80, optimum="low" → below low → success
value=20 (== low), optimum="low" → at-or-below low → success
value=50, optimum="low" → between low and high → warning
value=80 (== high), optimum="low" → at-or-above high → danger
value=90, optimum="low" → above high → danger

low 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

Do

Real thresholds that mean something operationally, so the auto-tone is trustworthy.

Avoid

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.

info success warning danger neutral
high low
sm md
React, generated from the controls
<AppMeter value={62} size="sm" label="Disk usage" />
Razor, the same props
<app-meter value="62" size="Sm" label="Disk usage" />

10 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
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

PropTypeDefaultDescription
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 pairs

Use meters for measurements, not tasks

Do

Real thresholds that mean something operationally, so the auto-tone is trustworthy.

Avoid

A task advancing toward completion is not a measurement: that is AppProgress, not AppMeter.