-
-
Save TheShubhamVsnv/f93013b3f8c42b095d45f27e29b77f67 to your computer and use it in GitHub Desktop.
Base 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: 'Access Denied', | |
message: 'The toast message goes here.', | |
variant: 'Base', | |
mode: 'dismissable' | |
}); | |
this.dispatchEvent(event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment