Today In this post we will going to learn about how to create modal/Popup in Lightning web Component.
What is Model/Popup In Lightning Web Component (LWC).
Modals/Popup Box are used to display content in a layer above the app. This paradigm is used in cases such as the creation or editing of a record, as well as various types of messaging and wizards
Step 1:- Create a Lighting web component in your org.
Component.html
Welcome in Sfdc Pathshala
Modal/Popup in Lightning Web Component (LWC)
Component.js
import { LightningElement ,track} from 'lwc';
export default class ModelPopUpTOCreateAccount extends LightningElement {
@track isShowModal = false;
handleClickOpen() {
this.isShowModal = true;
}
hideModalBox() {
this.isShowModal = false;
}
}
Component.js-meta.xml
55.0
true
lightning__AppPage
lightning__RecordPage
lightning__HomePage
lightning__Tab
You can customize above model/popup according to your requirement.
Output : -
