Skip to content

ProgressBar ​

A ProgressBar is a visual element used to indicate the progress of an action or process.

NameValue
Props
inline
ariaLabel
value
startLabel
endLabel
max
disabled
View
Reading direction

Overview ​

When to use ProgressBar ​

Use a ProgressBar when you want to provide real-time feedback on the progress of ongoing operations (such as file uploads or form submissions), or when you or when you want to show progress toward a known result. There are different types of ProgressBars, depending on your intended use.

  1. Indeterminate ProgressBar (default)
    Use this variant to show that an operation is in progress when the amount of progress can’t be measured (for example, loading or processing with an unknown duration). This variation indicates that the ongoing system process will affect an entire view or area.
  • Inline is available to indicate progress within other components, such as Menu or Dialog.
  1. Determinate ProgressBar
    Use this variant when progress is measurable and can be represented against a known total (for example, completion percentage or progress toward a goal).

Avoid using a ProgressBar if the progress of a task is not crucial to user understanding or if the task is expected to complete quickly.

About ProgressBar ​

ProgressBar includes the following elements.

Progress element ​

Visual representation of the progress displayed as a filled bar.

Bar container ​

Container that holds the progress bar, showing the extent of the progress.

Label ​

The determinate ProgressBar can include optional labels at both sides of the bar container.

  • Use a contextual label that describes what the progress represents.
  • Place the counter progress at the end of the ProgressBar
  • Format progress values as X / Y, where the first number represents the current progress and the second number represents the total or goal. Use a forward slash ( / ) to minimize translation needs and maintain consistency across languages.

Examples ​

Basic usage ​

Determinate with labels ​

Labels can be added at either end of the bar using the startLabel and endLabel props. This is useful for showing numeric indicators such as β€œ0 / 100%” or other contextual information.

0%
25%

WARNING

Due to the lack of descriptive text, a default ProgressBar requires one of the following attributes: aria-label or aria-hidden.

The aria-label attribute must be applied to the ProgressBar to ensure it is accessible to assistive technology users. An exception is an inline ProgressBar used within another component, such as the Menu component, where they are excluded from the accessibility tree by adding aria-hidden attribute.

Inline ​

An inline version is available for use within other components. Refer to Menu for sample usage.

Technical implementation ​

Vue usage ​

Props ​

Prop nameDescriptionTypeDefault
valuenumber|nullnull
maxnumber100
inlineWhether this is the smaller, inline variant.booleanfalse
disabledWhether the progress bar is disabled.booleanfalse
startLabelstring''
endLabelstring''

CSS-only version ​

Markup structure ​

Inline ​

For an inline ProgressBar, add the cdx-progress-bar--inline class to the root <div>.

Disabled ​

For a disabled ProgressBar, add the cdx-progress-bar--disabled class to the root <div>.

Determinate ​

For a determinate ProgressBar, add the cdx-progress-bar--determinate class to the root <div> and set the CSS variables --cdx-progress-value and --cdx-progress-max in the style tag.