Class

Notification

kiss.ui.Notification(config)

Display a notification that disapears automatically (after 1 second by default)

Constructor

# new Notification(config)

You can create a Notification using the class or using the shorthand:

// Using kiss namespace
new kiss.ui.Notification(config)

// Using the shorthand
createNotification(config)
Parameters:
Name Type Attributes Description
config object
message string
background string <optional>

Background color. Default = #000000

color string <optional>

Font color. Default = #ffffff

fontFamily string <optional>

Font family. Default = Arial

fontWeight string <optional>

Font weight. Default = normal

top number <optional>

Top position. Default = 100

width string | number <optional>
height string | number <optional>
padding string | number <optional>

Default 10px

duration number <optional>

Duration in milliseconds. Default = 1000

View Source client/ui/elements/notification.js, line 18

this

Example
// Text with options
createNotification({
 message: "You've completed your task!",
 top: 500,
 duration: 2000
})

// Simple text
createNotification("Hello world")