Progress Bar

lightning:progressBar

Displays a horizontal progress bar from left to right to indicate the progress of an operation. This component requires API version 41.0 and later.

For Aura components only. For LWC development, use lightning-progress-bar.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App, Mobile Offline

A lightning:progressBar component displays the progress of an operation from left to right, such as for a file download or upload.

This component implements styling from progress bars in the Lightning Design System.

This example loads the progress bar on rendering and rerendering of the component.

1<aura:component>
2  <aura:handler name="render" value="{!this}" action="{!c.onRender}" />
3  <aura:attribute name="progress" type="Integer" default="0" />
4  <lightning:progressBar value="{!v.progress}" />
5</aura:component>

Here’s the client-side controller that changes the value of the progress bar. Specifying progress === 100 ? clearInterval(interval) : progress + 10 increases the progress value by 10% and stops the animation when the progress reaches 100%. The progress bar is updated every 200 milliseconds.

1({
2  onRender: function (cmp) {
3    var interval = setInterval(
4      $A.getCallback(function () {
5        var progress = cmp.get("v.progress");
6        cmp.set(
7          "v.progress",
8          progress === 100 ? clearInterval(interval) : progress + 10
9        );
10      }),
11      200
12    );
13  },
14});

Attributes 

NameDescriptionTypeDefaultRequired
bodyThe body of the component. In markup, this is everything in the body of the tag.Aura.Component[]
classA CSS class for the outer element, in addition to the component's base classes.String
sizeThe size of the progress bar. Valid values are x-small, small, medium, and large. The default value is medium.Stringmedium
titleDisplays tooltip text when the mouse moves over the element.String
valueThe percentage value of the progress bar.Integer0
variantThe variant of the progress bar. Valid values are base and circular.Stringbase