Skip to content

CdsProgressCircle

New in v4.0

A circular progress indicator shows the course of an operation: a file upload, data processing, a filling quota. The value is set in percent through model-value, and when the course of the operation is unknown, the indeterminate mode turns on an endless waiting animation.

Storybook GitLab
Test coverage: 100% — good coverage
API in specs
12 / 12 props, events, slots and exposed members with a test
Test cases
27 unit · 0 browser
Code coverage
100% lines · 95.5% branches measured in v4.0.0-alpha.13
A11y (axe)
14 recommendations in 13 stories measured in v4.0.0-alpha.11

For progress shown as a horizontal bar take CdsProgressBar, and to dim a container while it loads — CdsOverlay.

Variations ​

Value ​

The model-value prop is the current progress in percent, from 0 to 100. A change of the value is animated with a smooth transition of the arc.

The rotate prop turns the starting point of the arc by the given number of degrees. By default the progress grows clockwise from "12 o'clock".

Indeterminate progress ​

The indeterminate prop turns on an endless animation — use it when the course of the operation is unknown. The value disable-shrink leaves only the rotation without the pulsation of the arc: this animation is simpler and does not load the main thread. It is also enabled automatically for users with the prefers-reduced-motion setting.

Sizes ​

The size prop sets the diameter: from xs to xl or a number in pixels. The default size is md.

Stroke ​

The width prop sets the thickness of the stroke in pixels regardless of the diameter.

The rounded prop rounds the ends of the arc.

Colors ​

The color prop paints the progress arc, bg-color paints the background ring underneath. Both accept color tokens of the design system.

Content ​

The default slot renders content in the center of the ring and receives the current value through the value slot prop — a handy way to show the percentage next to the arc.

Reveal animation ​

The reveal prop animates the arc from zero to the current value when the component appears. The duration is configured with an object: :reveal="{ duration: 1500 }".

Guidelines ​

Scenarios ​

File upload ​

The upload progress is visible in the center of the ring through the default slot, and once it is done the percentage turns into a success icon. The rounded prop softens the arc, and color supports the positive scenario.

A filling quota ​

The ring shows not only a process but also a static value — the used storage space, for example. A computed color switches the indicator from green to yellow and red as the limit approaches.

A background operation ​

A compact indeterminate indicator of the xs size sits in a line with the text and reports that the operation that was started is still running. The caption next to it explains what to expect — without it a spinning ring says nothing.

API ​

Props

NameTypeDefaultDescription
bgColorstring | undefined—Background color of the loader
colorstring | undefined—Color of the loader
indeterminateboolean | "disable-shrink" | undefined—Shows the animation continuously; use it when the course of the loading is unknown. The string disable-shrink switches to a simpler animation that does not run on the main thread
modelValuestring | number | undefined0Current loading progress in percent
revealboolean | { duration?: number | undefined; } | undefinedfalseAnimates the indicator from zero to the current value when the component appears. The { duration } object sets the animation duration in milliseconds
rotatestring | number | undefined0Turns the starting point of the circle by the given number of degrees
roundedboolean | undefined—Rounds the ends of the progress arc
sizenumber | "xs" | "sm" | "md" | "lg" | "xl" | undefined'md'Size of the component
tagstring | JSXComponent<any> | undefined'div'Custom HTML tag or component to render
themestring | undefined—Component theme
widthstring | number | undefined4Sets the thickness of the circle stroke in pixels

Slots

NameTypeDescription
default{ value: number; }Default slot. Carries the progress value of the loading indicator.