Skip to main content
Login

Sign in to access your account

Progress - National Design System

A progress indicator shows how much of a task is done, as a circle or a bar

Overview

A progress indicator shows a value from 0 to 100. The circle draws it as a ring with the number in the middle, and a short text under the number. The bar draws it as a fill in a track, with a label above and a feedback message below. The circle can also show the value as a fraction, such as 3.75/5.

Pick another component when:

  • the wait has no known length: Loading
  • the user moves through named steps: Stepper
  • the user uploads files: Upload, which draws its own progress

Markup

Options
Structure
Circle size
Bar size
Status
More
Preview
% Active users
<div class="nds-progress-circle nds-lg" data-value="75" role="progressbar" aria-labelledby="progress-circle-text"> <svg width="120" height="120" viewBox="0 0 24 24"> <circle class="nds-progress-bg" cx="12" cy="12" r="10" fill="none" stroke-width="2" /> <circle class="nds-progress-track" cx="12" cy="12" r="10" fill="none" stroke-width="2" stroke-dasharray="62.83" stroke-dashoffset="62.83" stroke-linecap="round" /> </svg> <div class="nds-progress-info"> <span class="nds-feedback"> <span class="nds-feedback-icon"><i class="nds-icon" aria-hidden="true"></i></span> </span> <span class="nds-progress-percentage"> <span class="nds-progress-number"></span> <span class="nds-progress-symbol">%</span> </span> <span class="nds-progress-text" id="progress-circle-text">Active users</span> </div> </div>

Behavior

Out Of

The circle shows a score as a fraction, such as 3.75/5, in place of a percentage. Set data-num and data-max on the circle instead of data-value. The script writes the two numbers and fills the ring to their ratio. When both are set, they win over data-value.

Steps

The circle shows steps done out of all the steps, such as 2 / 4, the same as the ring of a radial Stepper. Set data-num and data-max, as for Out of, and write nds-progress-steps in place of nds-progress-out-of. Use it for a task the user moves through outside a stepper, such as a journey shown on a card.

Status

data-status="success" fills the indicator to 100% in the success color, whatever its value. data-status="error" keeps the fill where it is and turns it to the error color. On a circle, the status icon takes the place of the number. On a bar, the feedback icon below the track changes. Out of takes no status: a score does not succeed or fail.

Percentage in the Bar

A large bar (nds-lg) shows the percentage inside the fill, at its end. Small and medium bars are too thin for text, so they show no number. Use a large bar when the user needs the exact value.

Built-in Features

  • Auto-initialization

    The script starts every circle and bar that has data-value or data-num. No init call is needed.

  • Data-Driven Values

    Change data-value, data-num or data-max and the indicator redraws. A value above 100 shows as 100.

  • Scroll-triggered Fill

    The fill starts when half of the indicator is on the screen, so the user sees it move. With reduced motion, the value shows at once.

  • Smooth Transitions

    The fill moves to each new value in 0.3 seconds, on the circle and the bar.

  • Scalable Text

    The number, the text and the status icon grow with the circle, at every size class and at a custom --progress-size.

  • Screen Reader Value

    The script adds role="progressbar" if it is missing. It keeps aria-valuenow, aria-valuemin and aria-valuemax in step with the value. A screen reader reads the value before the fill starts.

  • Programmatic Control

    NDS.Progress.setValue() and NDS.Progress.setOutOf() change the value from code.

Best Practices

  • Name every indicator: point aria-labelledby at its label or text. Without a name, a screen reader reads only a number.
  • Set the value with data-value, not with --progress-value in style. The script reads the attribute, and the screen reader value comes from it.
  • Keep the circle text to one or two words. It shows only at LG and larger.
  • Write a bar label that names the task, such as the file name, and a feedback message that says what happens now.
  • Set data-status="success" only when the task is done.
  • Do not use a progress indicator for a wait with no known length. Use Loading.

API

Data Attributes

Attribute Element Effect
data-value .nds-progress-circle, .nds-progress-bar The value, 0 to 100
data-num, data-max .nds-progress-circle The fraction for Out of and Steps. Both are needed. They win over data-value
data-status .nds-progress-circle, .nds-progress-bar success or error. See Status under Behavior
aria-labelledby .nds-progress-circle, .nds-progress-bar The id of the element that names the indicator

For Out of, the script sets aria-valuemax to data-max, not 100.

CSS Custom Properties

Set these in the style of the circle or the bar. --progress-size wins over the circle’s size classes, and it also reaches the circle from a parent. The bar’s size classes set --progress-height on the bar, so a value set on a parent does not reach it.

Property Default Controls
--progress-value 0 The fill, 0 to 100. The script sets it from data-value
--progress-color var(--background-primary) The fill color
--progress-size 64px Circle only. The diameter
--progress-track-color var(--background-neutral-light) The ring behind the circle’s fill, or the track of the bar
--progress-circumference 62.83 Circle only. The ring length for an SVG circle with r="10". Change it only with a different radius
--progress-height 8px Bar only. The track height

Tokens

Set a token at :root, or on a wrapper to reach every progress indicator inside it. Give a token with a Dark mode value a dark override too: see Tokens. The neutral fill is the color of .nds-neutral. The neutral ring in a Stepper uses it too.

Source: the progress group in _sass/tokens/_components.scss.

TokenPreviewValue
--progress-background-primary
var(--background-primary)
Dark mode var(--colors-primary-500)
--progress-background-neutral
var(--colors-neutral-700)
Dark mode var(--colors-neutral-200)
--progress-text-primaryvar(--text-oncolor-primary)

It also reads these shared tokens. A change to one also changes other components.

Source: the var() reads in _sass/components/_progress.scss.

TokenPreviewValue
--background-surface-oncolor
Read by --progress-color
var(--colors-base-white)
--background-neutral-light
Read by --progress-track-color, background-color

var(--colors-neutral-100)
Dark mode var(--colors-alpha-white-10)
--background-success
Read by --progress-color
var(--colors-green-600)
--background-error
Read by --progress-color
var(--colors-red-600)
--text-default
Read by color

var(--colors-base-black)
Dark mode var(--colors-neutral-200)
--text-primary-paragraph
Read by color

var(--colors-neutral-700)
Dark mode var(--colors-neutral-300)
--text-secondary-paragraph
Read by color

var(--colors-neutral-500)
Dark mode var(--colors-neutral-400)
--text-oncolor-primary
Read by color, --feedback-symbol-color
var(--colors-base-white)

JavaScript

The NDS.Progress script loads after the page shows. Until it loads, each call loads it and returns a promise of the result, so await a call whose result you use.

Method Effect
NDS.Progress.init() Starts every indicator on the page. Call it after you add indicators
NDS.Progress.setValue(el, value) Sets data-value
NDS.Progress.setOutOf(el, num, max) Sets data-num and data-max
NDS.Progress.create(el) Draws one indicator from its attributes now, with no wait for scroll
NDS.Progress.destroy(el) Stops a reveal that is still waiting for the indicator to scroll into view

The component fires no events. The methods only write the attributes, so writing them yourself works the same. The full API is in the banner of _js/nds-progress.js.

var circle = document.querySelector('.nds-progress-circle'); NDS.Progress.setValue(circle, 80); var score = document.querySelector('.nds-progress-circle[data-max]'); NDS.Progress.setOutOf(score, 4.2, 5);
Last Modified Date: 05/11/2026 - 12:02 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks