Gravity
Search…
Notification
Notifications are mobile-style 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.
1
// structure: format and icon are optional to create a toast notification
2
context.notification.show(message, type, autoclose, format, icon);
3
4
// banner example
5
context.notification.show('Hello World!', 'success', true);
6
7
// toast example
8
context.notification.show('Hello World!', 'success', true, 'toast', 'heart');
9
10
// hide
11
context.notification.hide();
Copied!

Parameters

prop
description
value
message
the message text to display
string
type
determines the color of the banner
success, error or warning
autoclose
if false, the banner won't disappear until clicking the x icon.
true (default) or false
Last modified 1yr ago
Copy link
Contents
Parameters