abaabil

Progress

9th lightest of the twenty-three, by js weight

A native <progress> element. Leave value off and it is genuinely indeterminate, rather than claiming an unknown task is 0% done.

Example (a11y tier)

valueText is what makes this announce “3 of 8 files”.
No value, so the bar is indeterminate.

Import

import Progress from 'abaabil/progress'         // structure only
import Progress from 'abaabil/progress/styled'  // + CSS
import Progress from 'abaabil/progress/a11y'    // + label/description/valueText

What a progress bar announces

A bare <progress value="3" max="8"> is announced as “38 percent”. That is right for a percentage and wrong for everything else, which is most things: files copied, steps completed, seconds remaining. valueText sets aria-valuetext, which assistive technology reads in place of the percentage.

A <label> alone does not name it

<progress> is a labelable element, so <label for> is not wrong, but no accessible name is computed from it: axe names an <input> from identical markup and names neither <progress> nor <meter>. This tier points aria-labelledby at the label as well, so the name is explicit rather than left to differ between implementations. It is the kind of gap that a passing audit misses, because axe's progress-bar rule only inspects an explicit role="progressbar" and skips the native element entirely.

Props

PropTypeDefaultTierDescription
valuenumberallOmit for an indeterminate bar.
maxnumber100all
classNamestringallMerged with the base class.
labelstringa11yRendered as a real <label> and wired via aria-labelledby.
hideLabelbooleanfalsea11yHide it visually; it stays in the accessibility tree.
descriptionstringa11yHelp text, wired into aria-describedby.
valueTextstringa11yAnnounced instead of the percentage.