-
-
Save TheShubhamVsnv/035ec947459a7aed91ff1e3061b425dc to your computer and use it in GitHub Desktop.
Warning Toast Notifications .js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement } from 'lwc'; | |
import { ShowToastEvent } from 'lightning/platformShowToastEvent'; | |
export default class ToastExample extends LightningElement { | |
showToast() { | |
const event = new ShowToastEvent({ | |
title: 'Alert', | |
message: 'The toast message goes here.', | |
variant: 'Warning', | |
mode: 'dismissable' | |
}); | |
this.dispatchEvent(event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment