SweetAlert2 Pro

Theme selection

Toast Action

This is a basic example of a Toast action with "Title", "Message", "Icon type", and "Footer" text. All of the text strings in this plug-in support HTML code.
Toast messages are basically the same as "alert" messages but smaller and usually on the top-end position.

Timer and waitForResult

In this section, the Toast box disappears after some time due to the "timer" setting. The timer is a declarative option that can be set in seconds.

In addition to timers, there is one another important setting called "waitForResult". You can set the option waitForResult to "Yes" in case you need multiple toasts in sequence.

Custom Settings

All toast messages can be customized. For more detailed settings and options please visit https://sweetalert2.github.io/#usage.

Here is a basic example of usage :
{
    "iconColor":"darkred",
    "background":"orange",
    "timerProgressBar":true,
    "allowOutsideClick":true,
    "allowEscapeKey":true,
    "allowEnterKey":true,
    "showConfirmButton":true,
    "showDenyButton":false,
    "showCancelButton":false,
    "confirmButtonText":"Custom text",
    "denyButtonText":"No",
    "cancelButtonText":"Cancel",
    "confirmButtonColor":"darkred",
    "denyButtonColor":"",
    "cancelButtonColor":"",
    "reverseButtons":true,
    "focusConfirm":true,
    "focusDeny":false,
    "focusCancel":false,
    "showCloseButton":true
}

Position

In this section, we show the different possible positions to display toast messages.
Popup window position can be 'top', 'top-start', 'top-end', 'center', 'center-start', 'center-end', 'bottom', 'bottom-start', or 'bottom-end'.

Text Messages and Message Substitutions

The plug-in also supports text messages. You can set them in the global component settings or per toast message.
Text messages are supported in the following options :
  1. Title
  2. Message
  3. Footer
  4. Custom options


For this sample application, we used the following text messages:
UCSWAL2.TOAST.TITLE > "Toast type main message title!"
UCSWAL2.TOAST.TEXT > "This is a submessage. It's not <strong>mandatory</strong>."
UCSWAL2.TOAST.FOOTER > "<a href="https://united-codes.com/index.html">United Codes </a>  footer added on toast message."

Message substitutions can be used as replacement parameters. Message substitutions must be separated with a comma(,).
The plug-in supports up to 4 parameters. Text and text messages get populated with specified entities.
For example :
We set :
as title "UCSWAL2.TOAST.TITLE" > "Welcome %0,  would you like to see more %1?"
as message substitutions we specify "&APP_USER.,data".

The result will be: "Welcome APEX_PUBLIC_ROUTER, would you like to see more data?"