0.0.0 • Published 8 years ago

n-notification v0.0.0

Weekly downloads
5
License
-
Repository
github
Last release
8 years ago

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:'myft', // 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

'error', produces an error styled notification (red).
'success', styled green

any other type or if type is not provided, will result in a default FT pink notification.

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