Component

Meter represents a bounded scalar measurement, such as storage usage, health, quota, or score.

View component changelog
preview
React
"use client" import Meter from "@radui/ui/Meter" export default function MeterExample() { return ( <div style={{ width: "280px" }}> <Meter.Root aria-label="Storage used" value={72} minValue={0} maxValue={100} lowValue={30} highValue={85} getValueLabel={(value) => `${value}% capacity used`} > <Meter.Indicator /> </Meter.Root> </div> ) }
  • Uses the meter ARIA role for bounded measurements
  • Supports min, max, low, high, and optimum thresholds
  • Exposes data-state and threshold attributes for styling
  • Supports compound usage with Root and Indicator parts

Give the meter an accessible name with aria-label or aria-labelledby so people can tell what it measures. Use getValueLabel when the value needs a more descriptive announcement.

Import all parts of the component and piece them together

React
import Meter from "@radui/ui/Meter" export default () => ( <Meter.Root aria-label="Storage used" value={72} minValue={0} maxValue={100} lowValue={30} highValue={85}> <Meter.Indicator /> </Meter.Root> )

Root component for the Meter primitive.

PropTypeDefault
value
number
0
minValue
number
0
maxValue
number
100
lowValue
number
--
highValue
number
--
optimumValue
number
--
getValueLabel
(value, minValue, maxValue) => string
--
asChild
boolean
false
customRootClass
string
--
format
Intl.NumberFormatOptions
--
locale
string
browser locale

A visible name; the root is labelled by it.

PropTypeDefault
children
ReactNode
--

The current value as visible text: getValueLabel, then format, otherwise a rounded percentage. Hidden from screen readers, which hear the value from the root.

PropTypeDefault
children
(formatted, value) => ReactNode
--

The bar behind the Indicator. Optional; use it to place Label and Value beside the bar.

PropTypeDefault
className
string
--

Visual fill element for the Meter primitive.

PropTypeDefault
asChild
boolean
false
className
string
--
style
CSSProperties
--