useMeter

Provides the accessibility implementation for a meter component. Meters represent a quantity within a known range, or a fractional value.

25%
Example
Meter.tsx
Meter.css
Form.css
import {Meter} from './Meter';

<Meter label="Storage space" value={25} />

API

Shows a meter with labels pointing to its parts, including the label, fill, track, and value label elements.ValueLabelTasks completed4 of 5TrackFill
<Meter>
  <Label />
</Meter>
useMeter(props: ):

AriaMeterProps

NameTypeDefault
valuenumberDefault: 0

The current value (controlled).

valueLabelReactNodeDefault:

The content to display as the value's label (e.g. 1 of 4).

formatOptionsIntl.NumberFormatOptionsDefault: { style: 'percent' }

The display format of the value label.

MeterAria

NameType
meterPropsDOMAttributes

Props for the meter container element.

labelPropsDOMAttributes

Props for the meter's visual label (if any).