Skip to content

role progressbar

Progress bar draft v0.1.0

Shows how far a task has progressed, or that it is in progress when its length is unknown.

A progress bar fills a track from start to end as a task advances: an upload, an export, the steps of a setup. It has a visible label naming the task and, when the progress can be measured, an optional value in percent. When the length is unknown, the bar is indeterminate: a segment moves along the track to say that something is happening. It only reports: a progress bar is never a control.

Guidelines

From apps/docs/content/components/progress-bar.md

Overview

A progress bar fills a track from start to end as a task advances: an upload, an export, the steps of a setup. A visible label names the task; the value can be shown in percent when it is measured. When the length of the task is unknown, the bar is indeterminate: a segment moves along the track to say that something is happening. A progress bar only reports; it is never a control.

This page applies to every platform. Where a platform differs, the difference sits under a sub-heading named after it (Web, iOS, Android, Desktop); everything else holds everywhere.

When to use

  • A task that takes more than a moment and whose progress can be measured (upload, export, import).
  • The steps of a flow (step 3 of 5), as a bar under the step name.
  • A quantity against a limit (storage used), when the bar reads as a fill rather than a wait.

When not to use

  • A short wait of unknown length inside a button or a small area. That is a spinner, not in the system yet.
  • A value people set. That is a slider.

Sizes

Size Use for
Small Inline progress in lists and cards: a 4 px track.
Medium Standalone progress, the default: an 8 px track.

Label and value

The label names the task and is the accessible name of the bar; it never goes away. The value, when shown, sits at the end of the label row in percent. Show it when people wait for it and it is accurate; hide it when it jumps or stalls.

States

State How it happens What changes
Default The value is known. The indicator fills the track in proportion to the value.
Indeterminate No value is set. A segment moves along the track and keeps moving until a value is set or the bar is removed. Under reduced motion it rests at the start.

Prefer a determinate bar whenever the duration is known: a moving segment says that something happens, not how long it will take.

Content

  • The label names the task: Uploading 12 photos, Exporting report. Sentence case, no trailing punctuation.
  • When the task ends, replace or complete the bar with a message that says so (Upload complete).

Accessibility

The Specification tab lists the full accessibility contract. Each statement there links the source it comes from. This section explains the decisions behind it.

Web

  • The implementation renders a <progress> with value and max, named by a <label for> (a progress element is labelable); without value it is indeterminate (HTML: the progress element, ARIA in HTML: progress, HTML-AAM: progress).
  • The indeterminate look is the native one (:indeterminate); the forced state draws the same segment. The animation stops under prefers-reduced-motion (MDN: :indeterminate).
  • The sweep lasts six times the normal motion duration: the additions have no long duration token yet, so the factor is written in the CSS (an open decision).

iOS

Android

  • Alert (the message that reports completion or failure)