(params: {
status?: enum,
duration?: number,
message?: string,
description?: string,
placement?: enum,
bottom?: number,
top?: number
}): void
The Notification
action is used to display a notification message to a user.
Parameters
object
status: enum
: Message status type. Defaults tosuccess
. One of:success
error
info
warning
loading
.
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:topLeft
topRight
bottomLeft
bottomRight
bottom: number
: Distance from the bottom of the viewport, when placement isbottomRight
orbottomLeft
in pixels. The default is 24.top: number
: Distance from the bottom of the viewport, when placement istopRight
ortopLeft
in pixels. The default is 24.
Examples
Display a success notification:
- id: success
type: Notification
params:
message: Hello
Display 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: topRight
Display 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