Lightning Spinner Salesforce

|
| By Rishabh Sehgal

A lightning Spinner displays an animated spinner image to indicate that a feature or customization is loading. This component can be used when retrieving data or anytime when the operation takes time to complete so meanwhile, we can display a spinner.

How to add a spinner to your Lightning Web Component conditionally?

This means you can also show the spinner in the if condition.
Spinner.html

Lightning Spinner

Apply this code to your JavaScript –>

spinner1

This is the CSS used.

spinner2

By default, the spinner will load

spinner3

On clicking AboutWebner Button (if loaded = true condition will match and show the data).

spinner4

AboutWebner is the label name of the lightning button.

Leave a Reply

Your email address will not be published. Required fields are marked *