How can I make a progress bar’s value and label meaningful?
Quick answer
Give the progress indicator a concise name that explains what is progressing, such as “Uploading report.” If the amount completed is known, expose and update its current value within the defined range; if it is unknown, use an indeterminate indicator and omit the current value. Keep any completion message separate from the progress indicator so users receive a clear end state.
The question, the details, the next step.
A practical checklist
Use a label that names the operation, such as “Uploading report.”
Associate the label with the progress element or custom progress bar.
Expose and update a current value only when progress is known and measurable.
Omit
aria-valuenowfor indeterminate progress; do not guess a percentage.Use a separate, accurate completion state after the operation finishes.
A few more useful answers
Can I put the progress label inside the bar?
Do not rely on text nested inside a progress bar to provide its accessible name. Associate a label with native <progress>, or name a custom progress bar with aria-labelledby or aria-label. [S1]
What if my numeric value is not a meaningful percentage?
For an ARIA progress bar, aria-valuenow is announced as a percentage; when that would misrepresent progress, aria-valuetext can provide a human-readable alternative. [S2]
Does the progress-bar guidance specify how to announce completion?
The cited reference describes progress-value semantics but does not prescribe a separate completion announcement. Communicate completion as a distinct, accurate end state rather than implying that the reference mandates one particular pattern. [S2]
Sources
References used for this guide.
- [S1] MDN ARIA progressbar role reference developer.mozilla.org · Checked
- [S2] MDN ARIA aria-valuenow attribute reference developer.mozilla.org · Checked
