Toast

Toasts provide brief notifications. The component is also known as a snackbar.

The toast is used to show alerts on top of an overlay. The toast will close itself when the close button is clicked, or after a timeout — the default is 2 seconds. The toast component is used to give feedback to users after an action has taken place.

Usage

You can add this HTML code and Javascript code to get a toast in your website. You can click on the "SHOW TOAST" button for live demo.

HTML

You need to put this HTML code at the bottom just before closing the <body> tag.

Javascript