Toasts

Toasts allows you to create popup notifications that are less intrusive than Fandom's BannerNotifications.
== ==
== ==
The script's function won't be immediately available, but it will call a hook through mw.hook. To ensure it's available you can use:
Each toast has its own color and the non-default toasts have their own icons, which can be displayed using their own methods:
; show
: Type: Method
: Description: Displays a toast.
: Parameters:
:* content - Notification content.
:* options - An options object for tailoring the notification.
::* type - Possible values include: default, info, warning, error, and success.
::* icon - What type of icon to use, possible values include: info, warning, error, and success.
::* timeout - How long to display the notification for in milliseconds. Defaults to 3000ms.
; info
: Type: Method
: Description: Displays a toast using the info type.
: Parameters:
:* content - Notification content.
:* options - An options object for tailoring the notification.
::* icon - What type of icon to use, possible values include: info, warning, error, and success.
::* timeout - How long to display the notification for in milliseconds. Defaults to 3000ms.
; error
: Type: Method
: Description: Displays a toast using the error type.
: Parameters:
:* content - Notification content.
:* options - An options object for tailoring the notification.
::* icon - What type of icon to use, possible values include: info, warning, error, and success.
::* timeout - How long to display the notification for in milliseconds. Defaults to 3000ms.
; warning
: Type: Method
: Description: Displays a toast using the warning type.
: Parameters:
:* content - Notification content.
:* options - An options object for tailoring the notification.
::* icon - What type of icon to use, possible values include: info, warning, error, and success.
::* timeout - How long to display the notification for in milliseconds. Defaults to 3000ms.
; success
: Type: Method
: Description: Displays a toast using the success type.
: Parameters:
:* content - Notification content.
:* options - An options object for tailoring the notification.
::* icon - What type of icon to use, possible values include: info, warning, error, and success.
::* timeout - How long to display the notification for in milliseconds. Defaults to 3000ms.
== ==
Creates a standard toast and displays it for 5 seconds:
Creates various types of toasts: