Non-blocking Notification Library In JavaScript – Flag

Category: Javascript , Notification | September 21, 2017
Author: Bra1nSt0rm1ng
Views Total: 194
Official Page: Go to website
Last Update: September 21, 2017
License: MIT


Non-blocking Notification Library In JavaScript – Flag


Flag is a simple, performant, no-dependency JavaScript library used to show customizable non-blocking notifications on the web page.

How to use it:

Link to the Flat’s JavaScript and Stylesheet files:

<link rel="stylesheet" href="dist/flag.common.css">
<script src="dist/flag.common.js"></script>

Initialize the library and set the default position.

// default: top-right

Create the notifications with different themes:

//{message}, {title}, {size});'Info message.', 'info', 'middle');'Info message.', 'info');'Info message.');

// flag.success({message}, {title}, {size});
flag.success('Success message.', 'success', 'big');
flag.success('Success message.', 'success');
flag.success('Success message.');

// flag.warning({message}, {title}, {size});
flag.warning('Warning message.', 'warn', 'small');
flag.warning('Warning message.', 'warn');
flag.warning('Warning message.');

// flag.error({message}, {title}, {size});
flag.error('Error message.', 'error', 'middle');
flag.error('Error message.', 'error');
flag.error('Error message.');

Remove all the notifications.