This is very basic notifier to notify your user about something.
npm install simply-notifySimply notify
==========
This is a basic notifier that you can use in your es6 projects or you can use it directly in browser.
Demo
shell script
yarn add simply-notify
`
>If you want to use it directly in browser check the sample.html file in project root directory.
$3
It is build for browsers that support all modern features.
Please feel free to adapt it to your custom needs.
$3
Check package.json file.
$3
`js
import simplyNotifyObject from 'simply-notify'
simplyNotifyObject.addDanger('Danger message')
simplyNotifyObject.addInfo('Info message')
simplyNotifyObject.addSuccess('Success message')
simplyNotifyObject.addWarning('Warning message')
`
This code will display 4 toasts on screen. Clicking on one toast will make it disappear.
You can initialize the module to display auto-closing toast by setting a value greater then zero
to timer property.
`js
import simplyNotifyObject from 'simply-notify'
simplyNotifyObject.setTimer(2)
simplyNotifyObject.addDanger('Danger message')
`
This will make any toast displayed to disappear after 2 seconds.
There are four position for your messages:
`js
BOTTOM_LEFT
BOTTOM_RIGHT // default
TOP_LEFT
TOP_RIGHT
`
To set a position run
`js
import simplyNotifyObject from 'simply-notify'
import { TOP_RIGHT } from './src/toast/Position'
simplyNotifyObject.setPosition(TOP_RIGHT)
simplyNotifyObject.addDanger('Danger message')
`
Then all your messages will be displayed top right position.
Defaults:
- Position: `TOP_RIGHT`
- No timer
> When new position is set, toasts container is remove and recreated to the new position.
> Toasts are preserved and displayed in the new container at new location.
To see the behavior of this library please check the demo.
#### Development
To start webpack dev server run
`shell script
yarn start
`
To build the project run
`shell script
yarn build
`
To run linter run
`shell script
yarn lint
`
$3
In project root directory run
`shell script
yarn test
`
or
`shell script
yarn test-watch
``