n-notification Circle CI

Component for showing onsite notification bars to users.
Concurrent notifications are stacked, most recent at the top.

Using it

Programatically

const nNotification = require('n-notification');

nNotification.show({
    title: 'Optional title',
    content:'<p>Here is a message</p>',
    type: 'success', // optional see below
    duration: 7000 // optional, default is 5000
});

Custom Events

require('n-notification').init();

const event = new CustomEvent('nNotification.show', {detail: { content: 'Title' }});
document.dispatchEvent(event);

Types

type is optional, but if specified must have one of the following values:

Ideas for the future

  • Using the Notifications and PageVisibility APIs to show people notifications with the FT open in the background.
  • Firing messages and notifcations from Server Sent Events