Toast-style Non-blocking Notification Library – Notice

Category: Javascript , Notification | December 21, 2017
Author:firstandthird
Views Total:205 views
Official Page:Go to website
Last Update:December 21, 2017
License:MIT

Preview:

Toast-style Non-blocking Notification Library – Notice

Description:

Notice is a native JavaScript library to create various types of toast notifications with close buttons and configurable durations.

How to use it:

Install and import the Notice into your project.

# NPM
$ npm install @firstandthird/notice --save
import Notice form 'notice';

Create a basic toast notification.

Notice('Default Notification');

Override the default level (notification type).

Notice('Notification Message',{
  level: 'info' // 'default', 'info', 'success', 'warning', 'error'
});

Set the duration in milliseconds.

Notice('Notification Message',{
  level: 'info',
  timeout: 5000
});

Whether to show the close button on hover.

Notice('Notification Message',{
  level: 'info',
  showClose: true
});

Specify the container the notification message should append to.

Notice('Notification Message',{
  level: 'info',
  container: document.body
});

You Might Be Interested In:


Leave a Reply