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#
Pass a numeric value from 0 to max for determinate progress; max defaults to 100, and a
value outside the range is clamped. Omit value for indeterminate progress, which sets no
aria-valuenow and takes its aria-valuetext from the progress.indeterminate message. Use
animation (carousel, reverse, swing, or elastic) to change the indeterminate motion.
Label and value#
Supply aria-label or a labelling relationship when the surrounding context does not name the
operation. label fills the label slot, and a string label is also the default aria-label. An
explicit aria-label takes precedence. valueLabel shows the percentage in the value slot; pass a
formatter to customize both the displayed text and aria-valuetext. Without valueLabel,
aria-valuetext is still the formatted percentage. Indeterminate progress keeps the label and hides
the value.
Orientation#
Progress fills left to right by default. Set orientation="vertical" for a bar that fills from the
bottom, for example a battery or level meter. The vertical bar grows to its container height with a
minimum of 9rem.
Number format#
formatOptions accepts Intl.NumberFormat options and formats the displayed value and
aria-valuetext with the provider locale. A percent style formats the completed fraction; other
styles format value. Without formatOptions, the text is the percentage rounded to two decimals.
A valueLabel formatter takes precedence.
Examples#
Upload a file or wait on a scan#
Use a determinate value for known bytes. Omit value while a scanner has no trustworthy percentage.
Announce a bundle download#
Set label and valueLabel when the operation name and percentage should appear with the bar.
Keep aria-label as the accessible name.
Show horizontal and vertical meters#
Use orientation="vertical" for level meters that fill from the bottom.
API Reference#
Attributes#
data-indeterminatedata-progressProps#
Renders a <div> element by default.