n-notification

0.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i n-notification

Weekly Downloads

1

Version

0.0.0

License

none

Last publish

Collaborators

  • robertboulton
  • seraph2000
  • hamza.samih
  • notlee
  • emmalewis
  • aendra
  • the-ft
  • rowanmanning
  • chee
  • alexwilson