Skip to content

Instantly share code, notes, and snippets.

@TheShubhamVsnv
Created May 14, 2023 13:21
Show Gist options
  • Save TheShubhamVsnv/291363d3eebbda3a1140d0d7e4aa8e01 to your computer and use it in GitHub Desktop.
Save TheShubhamVsnv/291363d3eebbda3a1140d0d7e4aa8e01 to your computer and use it in GitHub Desktop.
Error Toast Notifications .js
import { LightningElement } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class ToastExample extends LightningElement {
showToast() {
const event = new ShowToastEvent({
title: 'Error',
message: 'The toast message goes here.',
variant: 'Error',
mode: 'dismissable'
});
this.dispatchEvent(event);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment