1.0.2 • Published 5 years ago
basic-notifier v1.0.2
Notifier
Basic notifier to display notices in browser.
Install
npm install basic-notifier
Browser support
Only modern browsers that support ES6.
Dependencies
Check package.json file.
Documentation
index.js file exports the following functions:
initWithCloseButton(position)
initWithTimer(position, seconds = 3)
addDanger(text)
addInfo(text)
addSuccess(text)
addWarning(text)
Bellow is a use-case that add a notice with a close button. The notice will disappear only when close button is actioned.
import {addDanger, addInfo, addSuccess, addWarning, initWithTimer, positions} from 'basic-notifier'
initWithTimer(positions.topRight)
addInfo('This is a info note')
Init function should be called once and then all notices will be added / removed as it dictates.
Available positions are:
- 'bottom-left'
- 'bottom-right'
- 'top-left'
- 'top-right'
However you can import them as in sample before and benefit of autocomplete.