Gravity
Search
K

Notification

Notifications are headline banner messages that appear at the top of the screen or toast notifications in the bottom right.
You can show a notification from anywhere using the ViewContext.

Preview

Code

// structure: format and icon are optional to create a toast notification
context.notification.show(message, type, autoclose, format, icon);
// banner example
context.notification.show('Hello World!', 'success', true);
// toast example
context.notification.show('Hello World!', 'success', true, 'toast', 'heart');
// hide
context.notification.hide();

Parameters

Param
Description
Required
Value
autoclose
toggle if the notification disappears automatically
optional
boolean (default: false)
message
message
required
string
type
set the color of the banner
required
info, success, error or warning
Last modified 5mo ago