Skip to contents

Meter

A graphical display of a numeric value within a range.

View as Markdown
Storage Used
x

Anatomy

Import the component and assemble its parts:

Anatomy

API reference

Root

Groups all parts of the meter and provides the value for screen readers. Renders a <div> element.

value*
Name
Description

The current value.

Type
aria-valuetextstring
Description

A string value that provides a user-friendly name for aria-valuenow, the current value of the meter.

Type
getAriaValueTextfunction
Description

A function that returns a string value that provides a human-readable text alternative for aria-valuenow, the current value of the meter.

Type
localeIntl.LocalesArgument
Name
Description

The locale used by Intl.NumberFormat when formatting the value. Defaults to the user’s runtime locale.

Type
minnumber0
Name
Description

The minimum value

Type
Default
0
maxnumber100
Name
Description

The maximum value

Type
Default
100
formatIntl.NumberFormatOptions
Name
Description

Options to format the value.

Type
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Meter.Root.PropsHide

Re-Export of Root props as MeterRootProps

Meter.Root.StateHide

Track

Contains the meter indicator and represents the entire range of the meter. Renders a <div> element.

classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Meter.Track.PropsHide

Re-Export of Track props as MeterTrackProps

Meter.Track.StateHide

Indicator

Visualizes the position of the value along the range. Renders a <div> element.

classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Meter.Indicator.PropsHide

Re-Export of Indicator props as MeterIndicatorProps

Meter.Indicator.StateHide

Value

A text element displaying the current value. Renders a <span> element.

children| ((formattedValue: string, value: number) => React.ReactNode)
| null
Type
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Meter.Value.PropsHide

Re-Export of Value props as MeterValueProps

Meter.Value.StateHide

Label

An accessible label for the meter. Renders a <span> element.

classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Meter.Label.PropsHide

Re-Export of Label props as MeterLabelProps

Meter.Label.StateHide