## Electron Notification Playbook

### Simple Example

The minimum requirements.

const notifier = require('electron-notifications') notifier.notify('Calendar')

### Full options

Shows you the full array of options you can use.

const notifier = require('electron-notifications') notifier.notify('Calendar', { message: 'Event begins in 10 minutes', icon: 'http://cl.ly/J49B/3951818241085781941.png', buttons: ['Dismiss', 'Snooze'], duration : 1000 })

### Stacking

Shows you the full array of options you can use with stacking

{i} will be replaced with the count

# of notifications
delay bewteen (ms)
const notifier = require('electron-notifications') notifier.notify('Calendar {i}', { message: 'Event begins in 10 minutes', icon: 'http://cl.ly/J49B/3951818241085781941.png', buttons: ['Dismiss', 'Snooze'], duration : 10000 })

### Vertical Buttons

If you prefer to use the vertical buttons style.

const notifier = require('electron-notifications') notifier.notify('Calendar', { message: 'Event begins in 10 minutes', icon: 'http://cl.ly/J49B/3951818241085781941.png', buttons: ['Dismiss', 'Snooze'], vertical: true, })

### Click event

Click on the notifiation to see the alert.

const notifier = require('electron-notifications') const notification = notifier.notify('Calendar') notification.on('clicked', () => { notification.close() alert('I was clicked!') })

### Swipe right event

Swipe the notification right to trigger the alert.

const notifier = require('electron-notifications') const notification = notifier.notify('Calendar') notification.on('swipeRight', () => { notification.close() alert('I was swiped!') })

### Click button

Click a button to see the action

const notifier = require('electron-notifications') const notification = notifier.notify('Calendar', { buttons: ['Dismiss', 'Snooze'], }) notification.on('buttonClicked', (text, index) => { notification.close() alert('You clicked "' + text + '" at index ' + index) })