Skip to content
IndexRequest a UIAboutContact

Progress Indicator

Linear and circular determinate progress with a readable percentage.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Build a determinate progress indicator with two views of the same value: a linear bar (8px tall, rounded) and a circular ring (96px, SVG circle with stroke-dasharray and stroke-dashoffset). Both are driven by one JS value from 0 to 100. Provide a "Start upload" button that advances progress with irregular steps (like a real upload) until 100, and a "Reset" button. The bar and ring use role="progressbar" with aria-valuenow, aria-valuemin 0, aria-valuemax 100 and an aria-label. A text readout shows the percentage in tabular digits. Width and offset transition 200ms linear. On completion the colour stays accent, a check icon replaces the number in the ring with a 240ms pop. Under prefers-reduced-motion remove transitions and the pop.

About this pattern

Definition

A visual that shows how much of a known task is complete. This page shows a linear bar and a circular ring driven by the same value, both announced to assistive technology.

Purpose & UX principles

  • Use when the duration or amount is known (uploads, multi-step tasks). Use a spinner when it is not.
  • Show the number as well as the shape; people want to know "how long".
  • Never let it go backwards or stall at 99% without explanation; if the real progress is unknown, show an indeterminate state.

Interaction states

  • Idle (0%), running, complete (check icon and accent colour), error (red, with a retry).
  • Uses role="progressbar" with aria-valuenow, aria-valuemin and aria-valuemax.

Motion specification

  • Bar width and ring offset follow the value with a 200ms linear transition so jumps look continuous.
  • Completion: a 240ms scale pop on the check icon.
  • Reduced motion: no transition and no pop.

Responsive behaviour

  • The bar fills its container; the ring keeps a fixed size (96px) and the percentage stays centred in it.

Code

HTML
<div class="box">
  <div class="top"><span>Uploading design.zip</span><b id="pct">0%</b></div>
  <div class="bar" role="progressbar" aria-label="Upload progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" id="bar"><i id="fill"></i></div>
  <div class="ringwrap"><svg viewBox="0 0 100 100" width="96" height="96" role="progressbar" aria-label="Upload progress ring" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" id="ring"><circle cx="50" cy="50" r="42" class="bg"/><circle cx="50" cy="50" r="42" class="fg" id="fg"/></svg><span id="mid">0</span></div>
  <div class="ctl"><button id="start">Start upload</button><button id="reset">Reset</button></div>
</div>

Related patterns

Spinner

↗
SpinnerLoading & Progress

Skeleton Loading

↗
Skeleton LoadingLoading & Progress

Range Slider

↗
Range SliderInputs & Forms