Skip to content
SENVENLI UI

Meter

A segmented gauge for a quantity within a known range, with warning and danger thresholds.
Usage against a limit
import { Meter } from "@senvenli/react/feedback";

Examples

Warning and critical

Past a threshold the segments and the value text change color; the value label says it in words too.

When low is bad

`badEnd="low"` warns as the value runs out.

Guidelines

When to use it

  • Showing how much of a limit is used: storage, seats, quota.

Use something else when

  • The value is a task's progress. Progress
  • One headline value on a dashboard reads better as a half ring with a target. Gauge chart

Accessibility

Built in

  • Exposed as a meter with its value text.

You provide

  • A label and a value label in real units.

API reference

Meter

labelRequired
React.ReactNode
valueRequired
number
maxValueRequired
number
badEnd
"high" | "low"Default "high"

Which end is the bad one: high (quota, usage; default) warns as the value grows, low (fuel, credit left) warns as it shrinks.

segments
numberDefault 10

Segments in the track: 10, or the real unit count (8 for fuel eighths).

thresholds
MeterThresholds
valueLabel
string

"38 / 50", "460 / 500 · 92%", "1/8 · refill soon": the state in words too, never colour alone. Defaults to "value / max".