Skip to content

notification

Marc Espín Sanz edited this page Apr 24, 2020 · 4 revisions

The Notification constructor is very simple. You pass an object as an unique argument with 3 properties.

Example of a Hello world notification:

function entry( API ){
	new API.Notification({
		title: 'Hello world!',
		content: 'This is the content :D'
	})
}

A more complex example using buttons:

function entry( API ){
	new API.Notification({
		title: 'Another notification',
		content: 'This one... has buttons!',
		buttons:[
			{
				label:'Click me!',
				action(){
					console.log('Ouch! You clicked me too hard >:c')
				}
			}
		]
	})
}
  • title: the title of the notification
  • content: the body of the notification
  • buttons: list of buttons
    • label: text of the button
    • action: function executed when the button is clicked

Documentation

Tutorials

Contributing

About

Clone this wiki locally