Lightning Progress Indicator in LWC

by Rijwan Mohmmed

Hello friends, today we are going to discuss Lightning Progress Indicator in LWC. Lightning Progress Indicator is a powerful component in the Lightning Web Components (LWC) framework that provides a visual representation of the progress of a task.

Also, check this: Embed VF page in LWC & two-way Communication

Key Highlights :

  1. Can be used to indicate the progress of a multi-step process, such as a form submission, or to indicate the progress of a long-running operation, such as a data import.
  2. lightning-progress-indicator the component displays a horizontal list of steps in a process, indicating the number of steps in a given process.
  3. Set type="path" to create a component that implements the path blueprint in the Lightning Design System. 
  4. Set type="base" to create a component that implements the progress indicator blueprint in the Lightning Design System.

Process & Code :


public class AccountDataController {
    @AuraEnabled(Cacheable = true)
    public static List<Account> getAccounts(){
      return [SELECT Id, Name,Industry, Type, Phone, Rating, AccountNumber FROM Account ORDER BY Name LIMIT 10];


	<div class="slds-card slds-m-horizontal_large">
		<!-- Spinner -->
		<div class="slds-is-relative slds-m-around_large slds-align_absolute-center"
			style="min-height: 300px; !important;" if:true={showSpinner}>
			<lightning-spinner alternative-text="Loading..." variant="brand"></lightning-spinner>
		<!-- /Spinner -->

		<template if:false={showSpinner}>
			<!-- Header -->
			<div class="slds-card__header slds-p-bottom_small">
					<lightning-progress-indicator current-step={currentStep} type="base" variant="base">
						<lightning-progress-step label="First Page" value="1" onclick={nextPage}>
						<lightning-progress-step label="Second Page" value="2" onclick={nextPage}>
						<lightning-progress-step label="Third Page" value="3" onclick={nextPage}>
			<!-- /Header -->

			<!-- First Page -->
			<template if:true={showFirstPage}>
				<div class="slds-p-around_large" style="height: 300px; !important;font-size:15px">
					<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
						the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
						of type and scrambled it to make a type specimen book. It has survived not only five centuries,
						but also the leap into electronic typesetting, remaining essentially unchanged. It was
						popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
						and more recently with desktop publishing software like Aldus PageMaker including versions of
						Lorem Ipsum.
					<p>It is a long established fact that a reader will be distracted by the readable content of a page
						when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal
						distribution of letters, as opposed to using 'Content here, content here', making it look like
						readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as
						their default model text, and a search for 'lorem ipsum' will uncover many web sites still in
						their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on
						purpose (injected humour and the like).</p>
			<!-- /First Page -->

			<!-- Second Page -->
			<template if:true={showSecondPage}>
				<div class="slds-p-around_large" style="height: 300px; !important;">
					<lightning-datatable key-field="Id" data={listOfAccounts} columns={columns}
			<!-- /Second Page -->

			<!-- Third Page -->
			<template if:true={showThirdPage}>
				<div class="slds-p-around_large" style="height: 300px; !important;">
					<lightning-record-form record-id={recordId} object-api-name="Account" fields={fields} columns="2"
						mode="edit" onsubmit={handleSubmit}>
			<!-- /Third Page -->

			<!-- Footer -->
			<footer class="slds-modal__footer slds-text-align_right" style="padding: 0.50rem 1rem;">
				<lightning-button class="slds-p-right_xx-small" label="Back" variant="neutral" onclick={previousPage}>
				<lightning-button label="Next" variant="brand" onclick={nextPage}></lightning-button>


import { LightningElement } from 'lwc';
import getAccounts from '@salesforce/apex/AccountDataController.getAccounts';

const columns = [{ label: 'Name', fieldName: 'Name', type: 'text'},
{ label: 'Phone', fieldName: 'Phone', type: 'text'},
{ label: 'Website', fieldName: 'Website', type: 'text'},
{ label: 'Industry', fieldName: 'Industry', type: 'text'}]

export default class ProgressIndicatorLWC extends LightningElement {
    step = 1;
    currentStep = "1";
    showFirstPage = true;
    showSecondPage = false;
    showThirdPage = false;
    fields = ['Name', 'Type', 'Phone', 'AccountNumber', 'Industry', 'Website'];
    columns = columns;

    getInitData() {
        this.showSpinner = true;
            .then(data => {
                this.listOfAccounts = data;
                this.showSpinner = false;
            .catch(error => {

    nextPage(event) {
        if (this.step != 3) {


    previousPage(event) {
        if (this.step != 1) {


    handleSetUpSteps() {
        this.showFirstPage = this.step == 1;
        this.showSecondPage = this.step == 2;
        this.showThirdPage = this.step == 3;
        this.currentStep = "" + this.step;

        if (this.step === 2) {
            this.showSpinner = true;


<?xml version="1.0"?>
<LightningComponentBundle xmlns="">

Output :

Reference :

  1. Progress Indicator
What’s your Reaction?

You may also like

Leave a Comment