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

Visual fill element for the Meter primitive.

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