Toasty

A minimal JavaScript notification module in Astral.js that provides a simple way to display customizable toast messages on the web page with CSS3 transition effects.

Link

All ready-to-use files required

<link href="https://cdn.jsdelivr.net/gh/thaboyaluya/Astral.CSS-2.3.4/css/astral.min.css" rel="stylesheet" >
<script src="https://cdn.jsdelivr.net/gh/thaboyaluya/Astral.CSS-2.3.4/js/astral.min.js"></script>

Usage

Simply make a plugin instance and then create a message using any of the following methods:

Toastify.default('Wow so easy')
Toastify.success('Wow so easy')
Toastify.error('Wow so easy')
Toastify.warning('Wow so easy')
Toastify.random() 

a message will appear in your web application!

Options

Here are the default options

const options={
    duration: 5000,// hide after 5000ms, // optional parameter
    callback:function(){console.log('✅ I am a callback function,Write your own function to override this !')},// executed when toast is clicked / optional parameter
    onHide:function(){console.log('✅ Do something after the toast disappears...')},// executed when toast has disappeared / optional parameter
    position:'toasts-top-right'// available position are :toasts-top-left,toasts-bottom-right and toasts-bottom-left
};

Public methods

List of available public methods:

Toastify.default(message,userOptions)
Toastify.success(message,userOptions)
Toastify.error(message,userOptions)
Toastify.warning(message,userOptions)
Toastify.random()