StartFoundationsComponentsContent

Progress bar

A progress bar shows how far a task has gone on a known scale. It only reports progress; it can't be focused or clicked.

Stable Figma
OverviewUsageAPIAccessibility
<tk-progress-bar value="60" show-value label="Uploading report.pdf"></tk-progress-bar>

Anatomy

Part What it is
tk-progress-bar the element; role="progressbar", never focusable
track the full-width rail: the whole scale
fill the done part, from the start edge
readout the value, beside or above the track, with show-value
default slot your own label or status text; replaces the readout

Variants

Import complete Import failed. Try again.
<tk-progress-bar value="60" show-value label="Import"></tk-progress-bar>
<tk-progress-bar value="100" intent="success" label="Import">Import complete</tk-progress-bar>
<tk-progress-bar value="40" intent="error" label="Import">Import failed. Try again.</tk-progress-bar>
  • accent (default): ordinary progress, including at 100%.
  • success: a finished task, with text that says so.
  • error: a failed task, with text that says what went wrong.

The bar never turns green on its own at 100%. Set intent yourself, and always add text; color alone doesn't tell everyone.

Segments

segments splits the track into equal cells. It's only a look: the value stays continuous, and the cells have no labels and no keyboard steps.

<tk-progress-bar value="3" max="5" segments="5" show-value value-format="fraction" label="Profile setup"></tk-progress-bar>

Sizes

<tk-progress-bar value="60" size="small" label="Uploading photos"></tk-progress-bar>
<tk-progress-bar value="60" label="Uploading photos"></tk-progress-bar>
size Thickness
small 4px (space-4)
medium (default) 8px (space-8)

States

<tk-progress-bar label="Loading messages"></tk-progress-bar>
  • Determinate: set value. It's clamped between min (0) and max (100).
  • Indeterminate: leave out value. A segment sweeps the track and no number shows; a slot label such as "Loading messages" still can. segments is ignored.

Value and readout

<tk-progress-bar value="18" max="25" show-value value-format="fraction" label="Files uploaded"></tk-progress-bar>
<tk-progress-bar value="72" show-value value-position="top" label="Exporting video"></tk-progress-bar>
  • show-value shows the value: 72% by default, or 18 of 25 with value-format="fraction".
  • value-position="top" puts it above the track; the default is beside it. It never sits on the fill.
  • Text in the default slot replaces the readout.