Recent chats
ASKGEEZ Q&A GUIDETechnology & devices

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.

LET’S WORK THROUGH IT

The question, the details, the next step.

Question

What makes a progress bar’s label useful? I have several operations on the same page, and “Loading” doesn’t tell people which one is underway.

Geez

Name the task, not just the fact that something is happening. “Uploading report” or “Preparing your export” gives more context than “Loading.” Keep the label outside the progress bar’s own contents: for a native <progress> element, associate a visible <label>; for a custom role="progressbar", provide a name using aria-labelledby or aria-label. MDN recommends native <progress> when it fits, and notes that a progress bar’s descendants are presentational, so nested text should not be relied on as its semantic name. [S1]

For example, assuming an upload whose total size is known, the markup might look like this:

<label for="report-progress">Uploading report</label>
<progress id="report-progress" value="30" max="100">30%</progress>

Treat the values here as illustrative. Match the range and value to the actual progress your application can measure.

Follow-up question

When should I show a percentage, and what should happen if I can’t calculate one?

Geez

Show a numeric value only when the application knows the current progress and what the range means. For a determinate custom progress bar, set and update aria-valuenow within its minimum and maximum; the default range is 0–100 if you do not define another range. If the amount completed is unknown, omit aria-valuenow rather than displaying a made-up percentage. [S1][S2]

If the value is meaningful as a percentage, that is what assistive technology will announce for an ARIA progress bar. If it is numeric but a percentage would be misleading, aria-valuetext can provide a human-readable description instead. [S2] For example, “Step 2 of 5” may communicate a stage-based process better than an invented percentage; use wording that accurately reflects the task.

Follow-up question

How should I update the indicator while work is happening, and how do I show that it finished?

Geez

When progress is measurable, update the exposed current value as the underlying work advances; keep the name tied to the same task. Do not make the number jump ahead of the actual work merely to look active. When progress is not measurable, keep it indeterminate and do not attach a guessed current value. [S1][S2]

Handle completion separately. For example, once an upload has actually finished, remove or replace the in-progress indicator and show a distinct status such as “Report uploaded.” This keeps “still working” and “finished” from being represented by the same value. The cited ARIA reference explains value semantics but does not prescribe how an application should announce a separate completion message, so choose and test a completion pattern appropriate to your interface. [S2]

Follow-up question

Can you give me a short checklist to review an implementation?

Geez

Use this review checklist:

  1. Name: Does the label identify the task, not merely say “Loading”?
  2. Association: Is the name programmatically associated with the indicator? Prefer native <progress> when suitable; otherwise name the custom progress bar.
  3. Value: Is progress genuinely measurable? If yes, expose and update a value within the chosen range; if no, omit aria-valuenow.
  4. Meaning: Would a percentage describe the progress accurately? If not, consider clear alternative value text rather than a misleading percentage.
  5. Completion: Is the finished state communicated separately, only after the work is complete?
  6. Check the result: Review the indicator as it starts, changes, and finishes, and confirm that its label and displayed value agree with what the application is doing.

This guidance covers naming and value semantics; it does not establish a single required design for completion announcements.

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-valuenow for 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.

  1. [S1] MDN ARIA progressbar role reference
    developer.mozilla.org · Checked
  2. [S2] MDN ARIA aria-valuenow attribute reference
    developer.mozilla.org · Checked

YOUR QUESTION. YOUR DETAILS.

Let’s work through your situation.

Get a tailored answer or help with your next task. Starts at $1, with a quote before you pay.

Ask your own question
← Back to Geez at Work