Meters are visual representations of a quantity or an achievement. Their progress is determined by user actions, rather than system actions.
Value
By default, the value prop is a percentage between 0 and 100. Use the minValue, and maxValue props to set a custom value scale.
API
| Name | Type | Default |
|---|---|---|
value | number | Default: 0
|
The current value (controlled). | ||
valueLabel | ReactNode | Default: — |
The content to display as the value's label (e.g. 1 of 4). | ||
variant | 'informative'
| 'positive'
| 'notice'
| 'negative' | Default: 'informative'
|
The visual style of the Meter. | ||
size | 'S'
| 'M'
| 'L'
| 'XL' | Default: 'M'
|
The size of the Meter. | ||
staticColor | 'white'
| 'black'
| 'auto' | Default: — |
The static color style to apply. Useful when the button appears over a color background. | ||
styles | StylesProp | Default: — |
Spectrum-defined styles, returned by the | ||
formatOptions | Intl.NumberFormatOptions | Default: { style: 'percent' }
|
The display format of the value label. | ||
label | ReactNode | Default: — |
The content to display as the label. | ||
labelPosition | LabelPosition | Default: 'top'
|
The label's overall position relative to the element it is labeling. | ||
minValue | number | Default: 0
|
The smallest value allowed for the input. | ||
maxValue | number | Default: 100
|
The largest value allowed for the input. | ||
id | string | Default: — |
The element's unique identifier. See MDN. | ||
aria-label | string | Default: — |
Defines a string value that labels the current element. | ||
aria-labelledby | string | Default: — |
Identifies the element (or elements) that labels the current element. | ||
aria-describedby | string | Default: — |
Identifies the element (or elements) that describes the object. | ||
aria-details | string | Default: — |
Identifies the element (or elements) that provide a detailed, extended description for the object. | ||
UNSAFE_className | UnsafeClassName | Default: — |
Sets the CSS className
for the element. Only use as a last resort. Use the | ||
UNSAFE_style | CSSProperties | Default: — |
Sets inline style for the
element. Only use as a last resort. Use the | ||
slot | string | null | Default: — |
A slot name for the component. Slots allow the component to receive props from a parent
component. An explicit | ||