Component for showing Messages to users
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
demos
src/js
tests
.gitignore
Makefile
README.md
bower.json
ft.yml
karma.conf.js
main.js
main.scss
origami.json
package.json
renovate.json

README.md

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:

  • 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