Flash (Toast) Messages In JavaScript – notify.js

Category: Javascript , Notification | February 24, 2020
Author:azzalfauzi
Views Total:3,839 views
Official Page:Go to website
Last Update:February 24, 2020
License:MIT

Preview:

Flash (Toast) Messages In JavaScript – notify.js

Description:

Yet another toast style notification library to send temporary flash messages to end-users.

Comes with 3 styles (danger, success, and default) and auto dismisses after 5 seconds by default.

How to use it:

1. Add notify.js and notify.css to the page.

<link rel="stylesheet" href="./notify.min.css" />
<script src="./notify.min.js"></script>

2. The JavaScript to display a basic toast message on the screen.

notify({
  message: 'Notification Message Here'
});

3. Apply a theme (danger or success) to the toast message.

notify({
  message: 'Notification Message Here',
  color: 'danger' // or 'success'
});

4. Determine the time to wait before dismissing. Defaults to 5000ms.

notify({
  message: 'Notification Message Here',
  color: 'danger'
  timeout: 5000
});

You Might Be Interested In:


Leave a Reply