
toast.js is a super simple JavaScript library that shows Android-style toast messages on your web applications. The toast message will destroy itself in a given amount of time.
How to use it:
Load the necessary toast.js JavaScript library in your project.
<script src="toast.js"></script>
Display a basic toast message on your web application.
iqwerty.toast.toast('Hello World!');Custom the duration. This toast message will auto-dismiss after a timeout (5000 ms).
const options = {
settings: {
duration: 5000,
}
};
iqwerty.toast.toast('Hello World!', options);Style the toast message.
const options = {
style: {
main: {
background: "#222",
color: "#fff",
},
},
};
iqwerty.toast.toast('Hello World!', options);Hide the toast message manually.
toast.hide();
Changelog:
08/05/2020
- API changed
07/19/2018
- Fix IE toast position








This documentation is wrong, I got an error using this methods. The correct ones is on their github repo.
https://github.com/mlcheng/js-toast