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

Preview:

Non-blocking Notification Library In JavaScript – Flag

Description:

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
flag.init('right');

Create the notifications with different themes:

// flag.info({message}, {title}, {size});
flag.info('Info message.', 'info', 'middle');
flag.info('Info message.', 'info');
flag.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.

flag.clean();