Skip to content
OAIT Design System

Design system / Components

Progress

A linear bar shows how much of a task is done and a spinner shows that something is happening; both always come with words.

When to use

  • Linear bar (8px): a known amount, shown on its own with its words: "Profile 80% complete", "Answered 12 of 120" with "10%" (D-CSN-28).
  • Thin bar (4px): the same inside rows, cards, and score bars: "Importing guests" with "48 of 120 rows done".
  • Spinner: an action of one to ten seconds whose length is unknown: 20px in a row, the icon's size in a button ("Saving…"), 48px in a region ("Getting your scan code…") (canonical §10.23, D-CAI-06).

How to wait, by duration (canonical §10.23, D-CSN-29):

Wait Show
Under 1 second Nothing new: keep the content, set [aria-busy="true"] on the region, and ignore repeated presses
1–10 seconds, after an action A spinner with words: in the button at the icon's size (the label becomes "Saving…"), or 48px in the region
Over 1 second, content with a known layout Skeleton blocks in the final layout
Work whose amount is known (an import, a profile, an assessment) The determinate linear bar with its words

When not to use

Situation Use instead
The steps of a flow ("Step 2 of 4") The stepper's segmented 4px bar
The pass's 30-second countdown The product-only ring of the QR pass
A list, table, or card that is loading Skeleton blocks
A figure that is a result, not progress ("12 on campus") A stat tile
Decoration, or a spinner with no words Nothing: every spinner has words (canonical §7.4)

Anatomy

Linear bar (.oa-progress):

  1. Label row (.oa-progress__label): the words, then an optional figure at the inline end (.oa-progress__value).
  2. Track (.oa-progress__track): the role="progressbar" element, full width and 8px or 4px tall.
  3. Indicator (.oa-progress__indicator): grows from the inline start to the value.

Spinner (.oa-spinner): a track ring in --color-outline-variant and a quarter arc in --color-primary-ink, turning once per second; its words sit beside it, outside the element. Inside a button the arc takes the label color (currentColor) with no track, at the button icon's size (D-CAI-06).

Variants

Variant Use for Key tokens
Linear, 8px (default) Standalone progress with its words bg-surface-container-highest track, bg-primary-ink indicator
Linear thin, 4px (.oa-progress--thin) Inside rows, cards, and score bars the same
Spinner, 20px (.oa-spinner, or .oa-spinner--sm to say so) Rows; buttons (resized to the button's icon) rows: --color-outline-variant track, --color-primary-ink arc; in a button: the arc in currentColor, no track; animate-spinner
Spinner, 48px (.oa-spinner--lg) A region or a page the same

Never primary (#f47920) as a progress color: it is 2.13:1 against its track and 2.63:1 against the page, under the 3:1 a graphic needs (D-CSN-28, D-COL-02).

Sizes

Size Height Padding Type style Icon size
Linear 8px track (a component constant), full width label row 8px above the track words body-md; figure label-md with tabular figures —
Linear thin 4px track as above as above —
Spinner 20px with a 2px stroke (in a button, the icon's size: 20px md and lg, 18px sm) — the words beside it take their context's style (label-md in a 40px button, body-md in a row) —
Spinner large 48px with a 4px stroke — body-md or body-lg words —

Tokens

Part Property Token
Track fill, corners --color-surface-container-highest, --radius-full
Indicator fill, corners --color-primary-ink (5.49:1 on the track in light, 7.20:1 in dark), --radius-full
Indicator width motion --duration-medium-2 (300ms), --ease-emphasized (canonical §7.3)
Label row type, gap --text-body-md; figure --text-label-md in --color-on-surface-variant; --space-2 (8px) above the track
Spinner track, arc --color-outline-variant, --color-primary-ink; in a button transparent, currentColor
Spinner turn --animate-spinner (oa-spin over --duration-loop-spinner, 1000ms, linear)
Spinner sizes 20px with a 2px stroke, 48px with a 4px stroke (component constants, D-ARC-24)

Local properties: --oa-progress-value (the width, set inline as a percentage); --oa-spinner-arc and --oa-spinner-track (re-pointed by a container whose ground is not a surface: the button and the banner's action point the arc at the label color and drop the track); --oa-spinner-size and --oa-spinner-stroke (a button sets the size to its icon's).

States

State What changes
Value changes The indicator's width moves to the new value over --duration-medium-2 with --ease-emphasized; the words change at the same time.
Empty (0%) The track alone, with words that say nothing is done yet.
Complete (100%) A full indicator and words that say so: "Your profile is complete".
Stopped by an error The bar keeps its last value and an error banner says what happened and what to do: "The import stopped before the end. Try again to carry on from where it stopped." (Global ID's guest import).
Spinner running One turn per --duration-loop-spinner, linear, only while waiting.
Reduced motion The bar jumps to its value; the spinner stands still as a quarter arc beside its words (canonical §7.7).
Hover, focus, pressed, disabled None: progress is not interactive.

Behavior

  • Updating a bar. Set the value on the wrapper (style="--oa-progress-value: 80%") and the track's [aria-valuenow] together, and update the words with them.
  • Announcing. A progress bar is not a live region. When the words must be heard as they change, put them in a polite status that is present before the work starts, as Global ID's guest import does with "{done} of {total} rows done" in a polite live region.
  • Spinners in buttons. The button's loading state carries the spinner: the button keeps its colors and focus, takes [aria-busy="true"] with [aria-disabled="true"], locks its width, and changes its label to waiting words ("Saving…"). The spinner takes the icon's place and size, its arc in the label color with no track, so it stays visible on every fill (canonical §10.0, D-CAI-06).
  • Spinners in regions. Put the 48px spinner and its words where the content will appear, inside a role="status" element; the spinner itself is always hidden from screen readers. Keep that element in the page before the wait starts and put the words into it: a status region added together with its words is not read reliably (canonical §13).
  • Fills from the inline start. The indicator is a block that grows along the inline axis, so it fills from the right in Arabic without any transform (canonical §14.2).
  • Forced colors. The track gains an edge in CanvasText, the indicator fills with Highlight, and the spinner draws a GrayText ring with a Highlight arc.

Accessibility

  • Role and value. The track is role="progressbar" aria-valuemin="0" aria-valuemax="100" with [aria-valuenow], named by the visible words through [aria-labelledby] (or aria-label="Profile 80% complete" when the words sit elsewhere) (D-CSN-28).
  • Words. The value is always visible in words as well; color and length are never the only signal (canonical §13).
  • Contrast. The indicator is 5.49:1 against the track in light and 7.20:1 in dark; primary would be 2.13:1, which is why progress fills are primary-ink (D-CSN-28, D-COL-03). Under the Tamakkan accent the indicator is Tamakkan's primary-ink.
  • Spinner. Decorative: <span aria-hidden="true">. The words carry the meaning; they sit in a status region or in the busy button's label.
  • Motion. The spinner stops and the bar jumps under reduced motion; words remain. Nothing loops after the wait ends.

RTL and languages

  • The bar fills from the right in Arabic and the figure moves to the inline end (the left); the spinner turns the same way in every language.
  • Western digits in every language. A percentage inside Arabic words sits in <bdi dir="ltr">: "اكتمل 80% من ملفك الشخصي" (canonical §3.6, §14.2).
  • French puts a no-break space before the percent sign ("Profil complété à 80 %", canonical §14.3), so the figure and its sign never part at a line end; format figures with Intl.NumberFormat, which adds it, never by hand. Global ID's French string has a plain space there today.

Content

  • The words name the task and the amount: "Profile 80% complete", "Answered 12 of 120" with "10%", "48 of 120 rows done".
  • Waiting words: the verb in -ing and the single ellipsis character: "Saving…", "Sending…", "Getting your scan code…", "Waiting for your device…", "Preparing your demo…". Never three full stops (canonical §12.2, §12.4).
English Arabic French
Profile 80% complete اكتمل 80% من ملفك الشخصي Profil complété à 80 %
Your profile is complete ملفك الشخصي مكتمل Votre profil est complet
Importing guests جارٍ استيراد الضيوف Importation des invités
Getting your scan code… جارٍ تحضير رمز المسح… Préparation de votre code à scanner…
Waiting for your device… بانتظار جهازك… En attente de votre appareil…

All five ship in Global ID.

Do and don't

Do Don't
Fill the indicator with primary-ink on surface-container-highest Fill it with the orange primary (2.13:1), or leave a native progress element in the browser's gray
Write the value in words beside the bar Show a bare bar, or a figure without its meaning
Pair every spinner with waiting words Spin a lone spinner, or keep it spinning after the wait
Use skeleton blocks for a list that takes more than a second Cover a known layout with a big spinner
Let the bar grow from the inline start Mirror it with a transform, or animate its height
Use the stepper bar for the steps of a flow Put "Step 2 of 4" in a progress bar

Code

HTML (reference CSS)

<div class="oa-progress" style="--oa-progress-value: 10%">
  <p class="oa-progress__label" id="fb-progress-answers"><span>Answered 12 of 120</span><span class="oa-progress__value">10%</span></p>
  <div class="oa-progress__track" role="progressbar" aria-labelledby="fb-progress-answers" aria-valuemin="0" aria-valuemax="100" aria-valuenow="10"><span class="oa-progress__indicator"></span></div>
</div>

Thin:

<div class="oa-progress oa-progress--thin" style="--oa-progress-value: 40%">
  <p class="oa-progress__label" id="fb-progress-import"><span>Importing guests</span><span class="oa-progress__value">48 of 120 rows done</span></p>
  <div class="oa-progress__track" role="progressbar" aria-labelledby="fb-progress-import" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40"><span class="oa-progress__indicator"></span></div>
</div>

Spinners with their words:

<p class="oa-cluster" role="status"><span class="oa-spinner" aria-hidden="true"></span><span>Getting your scan code…</span></p>
<p class="oa-cluster" role="status"><span class="oa-spinner oa-spinner--lg" aria-hidden="true"></span><span>Preparing your demo…</span></p>

Arabic:

<div class="oa-progress" style="--oa-progress-value: 80%">
  <p class="oa-progress__label" id="fb-progress-ar"><span>اكتمل <bdi dir="ltr">80%</bdi> من ملفك الشخصي</span></p>
  <div class="oa-progress__track" role="progressbar" aria-labelledby="fb-progress-ar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="80"><span class="oa-progress__indicator"></span></div>
</div>

Every variant is in reference/snippets/feedback.html.

Tailwind CSS v4

<div className="flex w-full flex-col gap-2">
  <p id="answers" className="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 text-body-md text-on-surface">
    <span>Answered 12 of 120</span>
    <span className="text-label-md tabular-nums text-on-surface-variant">10%</span>
  </p>
  <div
    role="progressbar"
    aria-labelledby="answers"
    aria-valuemin={0}
    aria-valuemax={100}
    aria-valuenow={10}
    className="block h-2 w-full overflow-hidden rounded-full bg-surface-container-highest forced-colors:border forced-colors:border-[CanvasText]"
  >
    <span
      className="block h-full w-(--oa-progress-value) rounded-full bg-primary-ink transition-[width] duration-medium-2 ease-emphasized forced-colors:forced-color-adjust-none forced-colors:bg-[Highlight]"
      style={{ "--oa-progress-value": "10%" } as React.CSSProperties}
    />
  </div>
</div>

Thin bars use h-1 on the track. Spinners:

<span aria-hidden="true" className="inline-block size-5 shrink-0 animate-spinner rounded-full border-2 border-outline-variant border-t-primary-ink align-middle forced-colors:forced-color-adjust-none forced-colors:border-[GrayText] forced-colors:border-t-[Highlight]" />
<span aria-hidden="true" className="inline-block size-12 shrink-0 animate-spinner rounded-full border-4 border-outline-variant border-t-primary-ink align-middle forced-colors:forced-color-adjust-none forced-colors:border-[GrayText] forced-colors:border-t-[Highlight]" />

Inside a button the spinner takes the icon's size (size-5, size-4.5 in sm) with border-transparent border-t-current in place of border-outline-variant border-t-primary-ink (button). Use animate-spinner, never Tailwind's spin animation; the reduced-motion switch in base CSS stops it (canonical §4.12, V-7). shadcn/ui's Progress: track bg-surface-container-highest, indicator bg-primary-ink, 8px or 4px.

React

Prop Type Default Description
value number — 0 to 100; outside values and NaN are held to the nearest end.
label string — The visible words, which also name the bar: "Profile 80% complete".
valueText string — An optional figure at the inline end: "10%", "48 of 120 rows done".
thin boolean false The 4px track for rows, cards, and score bars.

Spinner takes a size prop ("sm" 20px, the default, or "lg" 48px) and always renders hidden from screen readers; put its words next to it.

<Progress value={percent} label={t("me.progress.label", { percent })} />

<p role="status" className="flex items-center gap-3">
  <Spinner />
  {t("pass.checking")}
</p>