Skip to content

e1016/naranja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍊 Naranja

Pure JS, HTML, and CSS Notifications with a great look – Live demo

npm install --save naranja

Script

<script src="https://unpkg.com/naranja@1.0.1/lib/naranja.min.js"></script>

Styles

<link rel="stylesheet" href="https://unpkg.com/naranja@1.0.1/lib/naranja.min.css">

npm i -s 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

About

🍊 Web notifications with a great look

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published