(params: {
status?: enum,
duration?: number,
message?: string,
description?: string,
placement?: enum,
bottom?: number,
top?: number
}): voidThe Notification action is used to display a notification message to a user.
Parameters
object
status: enum: Message status type. Defaults tosuccess. One of:successerrorinfowarningloading.
duration: number: Time in seconds before the notification disappears. When set to 0 or null, it will never be closed automatically. The default is 5.message: string: The title of notification. Default is "Success".description: sttring: The content of the notification.placement: enum: Position of the notification. Default isbottomRight. Can be one of:topLefttopRightbottomLeftbottomRight
bottom: number: Distance from the bottom of the viewport, when placement isbottomRightorbottomLeftin pixels. The default is 24.top: number: Distance from the bottom of the viewport, when placement istopRightortopLeftin pixels. The default is 24.
Examples
Display a success notification:
- id: success
type: Notification
params:
message: HelloDisplay an info notification with a description:
- id: info
type: Notification
params:
message: Something happened
status: info
description: This is a longer description of the thing that happened, so that you know why it happened.
duration: 10
placement: topRightDisplay an warning notification that does not disappear until closed:
- id: warning
type: Notification
params:
message: Something bad might happen.
status: warning
description: This is a longer description of the thing that happened, so that you know why it happened.
duration: 0
placement: topRight