Appica UIUI 1.0.0

Meter

A graphical display of a numeric value within a known range.

Storage
x

Usage

A Meter displays a static measurement inside a known range — disk usage, a score, remaining battery — as opposed to Progress, which tracks a task moving toward completion. Compose it from parts: MeterLabel names the reading, MeterValue prints the formatted number, and MeterProgress draws the track and fill. The root lays them out on a grid — label top-left, value top-right, track spanning underneath — so you can drop in only the parts you need.

By default the fill uses the primary accent. Pass the low, high, and optimum thresholds and the indicator recolors itself to signal whether the current reading is good, borderline, or bad — green, amber, or red.

Examples

Default

A label, a formatted value, and a track. value is read against the default 0–100 range, and MeterValue renders it as a percentage out of the box.

Status thresholds

Pass low, high, and optimum and the indicator colors itself by zone: optimum (green) when the value sits on the same side as optimum, suboptimum (orange) one zone away, and invalid (red) at the far end. Here optimum={10} marks low usage as healthy, so a high reading turns red.

Formatting the value

The root's format takes Intl.NumberFormatOptions — render the value as currency, a unit, and so on. For full control, pass a function as MeterValue's children to wrap the formatted string in your own text.

Password strength (controlled)

A real-world meter: score the input as the user types, map the score to a custom range (max={4}), and use the thresholds to drive the red → amber → green color. The MeterValue children print a word ("Fair", "Strong") instead of a number.

Minimal

Drop MeterValue (and even MeterLabel) to render a bare track — handy for compact lists where the label alone carries the meaning. Restyle the track height and label with className.

RTL

Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior follows the same direction.

Under RTL the label and value swap sides and the track fills from the right. For setup details and caveats, see the RTL guide.

التخزين
x
النطاق الترددي
x

API reference

Meter wraps Base UI's Meter. Each part forwards ref and its remaining native attributes to the matching Base UI primitive — the tables below list the Appica additions and the most common props. When any threshold is set, the root exposes data-status (optimum | suboptimum | invalid) for styling, and the indicator carries data-slot="meter-indicator" with the threshold-derived background class.

Meter

The root. Owns the value, the range, and the threshold logic, and provides the resolved indicator color to MeterProgress. Renders a <div role="meter">.

MeterLabel

Names the meter and is wired to the root via aria-labelledby. Renders a <span>.

MeterValue

Prints the formatted value. Renders a <span>.

MeterProgress

The track and fill. Wraps the Track and renders the Indicator inside it, reading the resolved color from the root. Renders a <div>.

Accessibility

  • Meter renders role="meter" with aria-valuenow, aria-valuemin, and aria-valuemax set from value, min, and max.
  • Give every meter an accessible name — either a MeterLabel (wired automatically via aria-labelledby) or an aria-label on the root when you omit the visible label.
  • format and getAriaValueText shape aria-valuetext, so screen readers announce "$1,280.00" rather than a bare number.
  • Color alone shouldn't carry meaning — pair the status colors with the value or a word (as in the password-strength example) so the state is clear without color.
  • The fill transition honours prefers-reduced-motion.

© 2026 Appica UI. A free component library, crafted by the Appica team.