Component
Meter represents a bounded scalar measurement, such as storage usage, health, quota, or score.
View component changelogpreview
- 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
Root component for the Meter primitive.
| Prop | Type | Default |
|---|---|---|
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.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
className | string | -- |
style | CSSProperties | -- |