NotificationMixin

A mixin providing common notification functionality.

Inheritors

Properties

Link copied to clipboard
abstract var assertive: Boolean

When true, the notification card has aria-live attribute set to assertive instead of polite. This makes screen readers announce the notification content immediately when it appears.

Link copied to clipboard
abstract var duration: Double

The duration in milliseconds to show the notification. Set to 0 or a negative number to disable the notification auto-closing.

Link copied to clipboard
abstract var opened: Boolean

True if the notification is currently displayed.

Link copied to clipboard
abstract var overlayClass: String

A space-delimited list of CSS class names to set on the overlay element. This property does not affect other CSS class names set manually via JS.

Link copied to clipboard
abstract var position: String

Alignment of the notification in the viewport Valid values are top-stretch|top-start|top-center|top-end|middle|bottom-start|bottom-center|bottom-end|bottom-stretch

Link copied to clipboard

Custom function for rendering the content of the notification. Receives two arguments:

Functions

Link copied to clipboard
abstract fun close()

Closes the notification.

Link copied to clipboard
abstract fun open()

Opens the notification.

Link copied to clipboard
abstract fun requestContentUpdate()

Requests an update for the content of the notification. While performing the update, it invokes the renderer passed in the renderer property.

Link copied to clipboard
abstract fun show(contents: JsAny?, options: JsAny? = definedExternally)

Shows a notification with the given content. By default, positions the notification at bottom-start and uses a 5 second duration. An options object can be passed to configure the notification. The options object has the following structure: