Skip to content

Methods

destroy

Source code

notification.destroy()

Clears queues and toast state, unregisters shortcuts and focus scope, and removes the host from the DOM.

disablePlugin

Source code

notification.disablePlugin()

Hides all toasts, removes shortcuts and listeners, and destroys the UI host.

hideAll() must run before super.disablePlugin() because BasePlugin.disablePlugin() clears this.enabled first, and hideAll() relies on the plugin still being enabled. The superclass call then removes hooks and clears the shared EventManager.

enablePlugin

Source code

notification.enablePlugin()

Installs the notification host, document focusin listener (tab order + prior-focus for click paths), shortcuts (F6 via grid + global shortcut contexts, Escape, Tab, Shift+Tab), and the focus scope.

getQueueSize

Source code

notification.getQueueSize() ⇒ number

Returns how many toasts are waiting in per-position queues.

hide

Source code

notification.hide(id)

Hides a toast by id.

ParamTypeDescription
idstringToast id returned from Notification#showMessage.

hideAll

Source code

notification.hideAll()

Hides every visible toast and clears all per-position queues.

isEnabled

Source code

notification.isEnabled() ⇒ boolean

Returns whether the notification setting is enabled for this instance.

isVisible

Source code

notification.isVisible([id]) ⇒ boolean

Returns whether a toast is visible, or whether any toast is visible when id is omitted.

ParamTypeDescription
[id]stringoptional Toast id.

showMessage

Source code

notification.showMessage(options) ⇒ string

Displays a toast. Returns the toast id, or an empty string when the toast is not shown.

Throws:

  • Error When options is invalid or actions are malformed.
ParamTypeDescription
optionsobjectToast options.
[options.variant]'info'
'success'
'warning'
'error'
optional Visual variant.
[options.title]stringoptional Optional title.
options.messagestring
HTMLElement
Main message body.
[options.duration]numberoptional Auto-dismiss delay in ms. 0 keeps the toast until dismissed manually.
[options.position]'top-start'
'top-end'
'bottom-start'
'bottom-end'
optional Corner stack.
[options.closable]booleanoptional Whether the close control is shown.
[options.actions]Array<NotificationActionSpec>optional Action buttons.

updatePlugin

Source code

notification.updatePlugin([newSettings])

Rebuilds the plugin after settings change when notification options actually change.

ParamTypeDescription
[newSettings]objectoptional Settings object passed to updateSettings (partial).