naranja
v1.0.4
Published
Notifications for modern web design
Downloads
125
Maintainers
Readme
npm install --save naranja
// script
import naranja from 'naranja'
// styles
import '~/naranja/lib/naranja.min.css'
For first, why naranja? ... because all cool names in npm are taken, yes, and is easy to remember (it's orange in English).
naranja().log({
title: 'Notification Title', // <- required
text: 'Here goes a description for notifiaction', // <- required
icon: true or false, // <- unrequired, default true,
timeout: 2000 or 'keep', // <- unrequired, default 5000 miliseconds
buttons: [
{
text: 'OK',
click: function (e) {
// click event close notifiaction
// unless you use preventClose method
e.preventClose()
// if you want close notifiaction
// manually, use closeNotification
e.closeNotification()
}
},
{
text: 'Cancel',
click: function () {
// make something here...
// you can (but you should not)
// add infinity buttons
}
}
]
})
more notifiactions
naranja().log({ ...
naranja().success({ ...
naranja().warn({ ...
naranja().error({ ...
All methods need the same arguments