Progress
Show measurable or indeterminate task progress.
Anatomy#
Usage#
Use Progress for measurable task completion or for work whose end is not yet known. Choose a determinate value only when it represents real progress. For a loading placeholder of content structure, use Skeleton.
Progress models#
- Determinate: pass a numeric
valuefrom0tomax(default100); values outside the range are clamped. - Indeterminate: omit
valuewhen total progress is unknown. Indeterminate bars omitaria-valuenow, setaria-valuetextfrom theprogress.indeterminatelocale message, and supportanimation('carousel','reverse','swing', or'elastic').
Label and value#
Supply aria-label (or a labelling relationship) when surrounding context does not name the operation:
label: fills thelabelslot. A stringlabelalso serves as the defaultaria-labelunless an explicitaria-labelis passed.valueLabel: renders the formatted percentage in thevalueslot (hidden while indeterminate). Pass a function({ value, max, percent }) => stringto customize both the displayed text andaria-valuetext. WithoutvalueLabel,aria-valuetextstill reports the formatted percentage.
Orientation#
Progress fills horizontally from left to right by default. Set orientation="vertical" for a bar that fills from the bottom (such as a battery or level meter), growing to its container height with a 9rem minimum.
Number format#
formatOptions accepts Intl.NumberFormat options and formats both the displayed value and aria-valuetext using the provider locale:
- Without
formatOptions, the text defaults to the completed percentage rounded to two decimal places. - With
formatOptions, it formats the rawvalue(like Slider) rather than the completed fraction, so{ style: 'percent' }expectsmax={1}. - A custom
valueLabelformatter function takes precedence overformatOptions.
Examples#
Determinate and indeterminate#
Pass a numeric value for determinate progress, or omit value for an indeterminate bar.
Label and value#
Set label and valueLabel when the operation name and percentage should appear with the bar. A
string label also names the progressbar, so no separate aria-label is needed.
Orientation#
Use orientation="vertical" for level meters that fill from the bottom.
API Reference#
Attributes#
data-indeterminatedata-progressProps#
Renders a <div> element by default.