Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of custom lightning spinner Show/Hide & Toggle on click button with display a modal popup open/close Uses of “lightning-spinner” elements in Salesforce Lightning Web Component #48

Open
vijayk3327 opened this issue Jul 14, 2023 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@vijayk3327
Copy link
Owner

In this post we are going to learn about How to custom lightning spinner Show/Hide & Toggle on click button with display a modal popup open/close Uses of “lightning-spinner” elements in Salesforce Lightning Web Component Salesforce.

→ Get source code live demo link:-

Step 1:- Create Lightning Web Component HTML ➡ lwcSpinner.html

`

Display Spinner as Show/Hide and Toggle in Lightning Web Component (LWC)


`

Step 2:- Create Lightning Web Component Javascript ➡ lwcSpinner.js

` import { LightningElement, api } from 'lwc';

export default class LwcSpinner extends LightningElement {
@api spinnerStatus = false;

toggleSpinner() {
    this.spinnerStatus = !this.spinnerStatus;
}

showSpinner() {
    this.spinnerStatus = true;
}

hideSpinner() {
    this.spinnerStatus = false;
}

}`

Step 3:- Create Custom Style CSS ➡ lwcSpinner.css

btnOverw3web{ position: absolute; z-index: 9999; display: block; }

Step 4:- Create Lightning Web Component Meta XML ➡ lwcSpinner.js-meta.xml

<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>45.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AppPage</target> <target>lightning__RecordPage</target> <target>lightning__HomePage</target> </targets> </LightningComponentBundle>

Step 5:- Create Lightning Application : lwcSpinnerApp.app

<aura:application extends="force:slds"> <c:lwcSpinner/> </aura:application>

→ Get source code live demo link:-

@vijayk3327 vijayk3327 added documentation Improvements or additions to documentation question Further information is requested labels Jul 14, 2023
@vijayk3327 vijayk3327 self-assigned this Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
Status: No status
Development

No branches or pull requests

1 participant