Super Simple JavaScript Message Toaster – toast.js

Category: Javascript , Notification | August 5, 2020
Author:mlcheng
Views Total:18,246 views
Official Page:Go to website
Last Update:August 5, 2020
License:MIT

Preview:

Super Simple JavaScript Message Toaster – toast.js

Description:

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

You Might Be Interested In:


One thought on “Super Simple JavaScript Message Toaster – toast.js

Leave a Reply