useProgressBar

Provides the accessibility implementation for a progress bar component. Progress bars show either determinate or indeterminate progress of an operation over time.

80%
Example
ProgressBar.tsx
ProgressBar.css
Form.css
import {ProgressBar} from './ProgressBar';

<ProgressBar label="Loading…" value={80} />

API

Shows a progress bar with labels pointing to its parts, including the label, fill, track, and value label elements.ValueLabelLoading data…26%TrackFill
<ProgressBar>
  <Label />
</ProgressBar>
useProgressBar(props: ):

AriaProgressBarProps

NameTypeDefault
isIndeterminatebooleanDefault:

Whether presentation is indeterminate when progress isn't known.

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.

ProgressBarAria

NameType
progressBarPropsDOMAttributes

Props for the progress bar container element.

labelPropsDOMAttributes

Props for the progress bar's visual label element (if any).