Notification API

Properties

Name Description Type Required Default value
type Determines the color and icon of the notification. "default" | "info" | "success" | "warning" | "danger" | "loading" default
icon Determines the icon of the notification. string
color Determines the color of the title and the icon. It can be a named color (e.g. 'info') or a base color and shade (e.g. 'blue-400'). It works only if type is default. string
closable Makes the notification closable. Closed notification won't appear anymore. boolean false
autoclose Makes the notification automatically disappear. The remaining time is shown by an indicator. boolean false
key An identifier for storing closed state. It should be unique.
In Vue.js key is a reserved attribute. Use :key.prop="'somekey'" to set this attribute.
string

Method

Name Description
close() Close the notification.

Events

Event Description Returns
appear Fires when the component rendered
{
    detail: {
        component: [as object]
    }
}
close Fires on close

JavaScript API Reference

Method

Name Description
window.e.utils.openNotification(options) Opens notification on top window.
Returns a { close } object, where close is a function that closes the notification.

Parameters

Name Description Type Required Default value
content The content of the confirmation dialog. If string is given, it will be rendered as text. string | object true
content.type Decides whether the content will be rendered as text or html. 'text' | 'html' true
content.template The content of the confirmation dialog. string true
title The text content of the title. string
subtitle The subtitle of the confirmation dialog. If string is given, it will be rendered as text. string | object
subtitle.type Decides whether the subtitle will be rendered as text or html. 'text' | 'html' true
subtitle.template The subtitle of the confirmation dialog. string true
type The type of the notification. See details above. string default
icon The icon of the notification. See details above. string
color The color of the notification. See details above. string
helperLink Shows a helper link in the footer. object
helperLink.text The text content of the helper link. string true
helperLink.href The href of the helper link. string true
buttons Shows buttons in the footer. array
buttons[].text The text content of the button. string true
buttons[].icon The icon of the button. string
buttons[].primary If true, the button will be primary. boolean false
buttons[].onClick A callback function that will be called when the button is clicked. function
closable Makes the notification closable. boolean true
autoClose If true, the notification will disappear after 5 seconds. boolean false
key An identifier for storing closed state. It should be unique. string
placement The placement of the notification. 'top' | 'bottom-right' 'top'
targetWindow The window that will show the notification. It should be overriden only in case the UI Framework is not present on top window (e.g. in some e2e testing frameworks). The UI Framework should be present on the given targetWindow. Window window.top