mmo-notification
1 symbol · generated 27 Oct 2026
mmo-notification
mmo-notification.jhs:1Notification element to display a notification or a modal following the attached class
- Extends
- CustomShadowElement
Index
| duration | a toast's time on screen, in milliseconds, before it closes by itself; 0 keeps it until closed. | |
| Duration static | How 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. | |
| title | the heading of the card | |
| header | anything else on the header line, next to the title | |
| (default) | the body | |
| footer | the buttons under it | |
| .modal | make the notification a modal | |
| .onboarding | make the notification an onboarding notification | |
| .info | set info colors for the notification | |
| .warning | set warning colors for the notification | |
| .error | set error colors for the notification | |
| .success | set success colors for the notification |
Attributes1
duration
mmo-notification.jhsa 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:49How long a success or info toast stays, in milliseconds, unless its duration says otherwise.
- Type
number
duration
readonlyaccessormmo-notification.jhs:99- Type
number
Methods10
init()
mmo-notification.jhs:51disconnectedCallback()
mmo-notification.jhs:84isToast()
mmo-notification.jhs:92| returns | boolean | whether the card is a toast, the one shape that may close by itself |
startTimer()
mmo-notification.jhs:114Start the toast's time on screen, from its whole duration.
stopTimer()
mmo-notification.jhs:125Stop the toast's time on screen: it stays until closed.
countDown()
mmo-notification.jhs:134Run or suspend the time left, following what holds the toast (init).
expire()
mmo-notification.jhs:149The toast's time is up: it fades out -- at once for who asked for less motion -- and closes.
show(elements)
mmo-notification.jhs:170Show a notification
| ...elements | ...HTMLElement | - The elements to show in the notification |
| returns | Promise | A promise that resolves when the notification is closed |
alert(elements)
mmo-notification.jhs:198Show a modal notification
| ...elements | ...HTMLElement | - The elements to show in the notification |
| returns | Promise | A promise that resolves when the notification is closed |
close(value)
mmo-notification.jhs:211Close the notification: it is put away, and whoever opened it hears about it.
| value | any | - The value to return when the notification is closed |
Slots4
title
mmo-notification.jhsthe heading of the card
<slot name="title">
header
mmo-notification.jhsanything else on the header line, next to the title
<slot name="header">
(default)
mmo-notification.jhsthe body
<slot>
footer
mmo-notification.jhsthe buttons under it
<slot name="footer">
CSS hooks6
.modal
mmo-notification.jhsmake the notification a modal
.modal
.onboarding
mmo-notification.jhsmake the notification an onboarding notification
.onboarding
.info
mmo-notification.jhsset info colors for the notification
.info
.warning
mmo-notification.jhsset warning colors for the notification
.warning
.error
mmo-notification.jhsset error colors for the notification
.error
.success
mmo-notification.jhsset success colors for the notification
.success