MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

mmo-notification

1 symbol · generated 27 Oct 2026

element

mmo-notification

mmo-notification.jhs:1

Notification element to display a notification or a modal following the attached class

<mmo-notification></mmo-notification>
Extends
CustomShadowElement

Index

durationa toast's time on screen, in milliseconds, before it closes by itself; 0 keeps it until closed.
Duration staticHow long a success or info toast stays, in milliseconds, unless its duration says otherwise.
duration readonly accessor
init()
disconnectedCallback()
isToast()
startTimer()Start the toast's time on screen, from its whole duration.
stopTimer()Stop the toast's time on screen: it stays until closed.
countDown()Run or suspend the time left, following what holds the toast (init).
expire()The toast's time is up: it fades out -- at once for who asked for less motion -- and closes.
show(elements)Show a notification
alert(elements)Show a modal notification
close(value)Close the notification: it is put away, and whoever opened it hears about it.
titlethe heading of the card
headeranything else on the header line, next to the title
(default)the body
footerthe buttons under it
.modalmake the notification a modal
.onboardingmake the notification an onboarding notification
.infoset info colors for the notification
.warningset warning colors for the notification
.errorset error colors for the notification
.successset success colors for the notification

Attributes1

duration

mmo-notification.jhs

a toast's time on screen, in milliseconds, before it closes by itself; 0 keeps it until closed. Without it, a success or info toast of the shell's stack (MMO.app.showNotification) closes after Duration, and any other stays until closed: an error or a warning is read before it goes, so is a toast offering a button (a reload), and a card the page lays out itself is the page's

duration

Properties2

Duration

staticmmo-notification.jhs:49

How long a success or info toast stays, in milliseconds, unless its duration says otherwise.

static Duration = 6000;
Type
number
An application sets it once: `customElements.get('mmo-notification').Duration = 8000`

Methods10

isToast()

mmo-notification.jhs:92
isToast()
returnsbooleanwhether the card is a toast, the one shape that may close by itself

expire()

mmo-notification.jhs:149

The toast's time is up: it fades out -- at once for who asked for less motion -- and closes.

expire()

show(elements)

mmo-notification.jhs:170

Show a notification

show(...elements)
...elements...HTMLElement- The elements to show in the notification
returnsPromiseA promise that resolves when the notification is closed

alert(elements)

mmo-notification.jhs:198

Show a modal notification

alert(...elements)
...elements...HTMLElement- The elements to show in the notification
returnsPromiseA promise that resolves when the notification is closed

close(value)

mmo-notification.jhs:211

Close the notification: it is put away, and whoever opened it hears about it.

close(value)The element stays in the dom -- a page that declares its own card reopens it with `show`. A card nobody keeps, like the toasts `MMO.app.showNotification` builds, is dropped by the one that created it, on this event.
valueany- The value to return when the notification is closed

Slots4

CSS hooks6