ArekUI
Docs

Toast / Snackbar

Toast notifications in every position, type and duration - triggered with one line of JavaScript.

Click a button to fire a toast; each one calls ArekUI.toast() with the options shown in its Code tab.

How to use
<script src="arekui.js"></script>

ArekUI.toast("Changes saved!");
ArekUI.toast("Something went wrong.", { type: "error", icon: "✕", duration: 0, position: "bottom-left" });

<button class="ar-btn" onclick="ArekUI.toast('Changes saved!')">Notify me</button>

Requires arekui.js · the default type is info · hover a toast to pause its timer

Types
Positions
Sticky and dismiss

Options

NameType / valuesDefaultMeaning
typeinfo success warning errorinfoColour treatment via the matching ar-toast-* class.
durationmilliseconds40000 keeps the toast open until it is dismissed. Hovering pauses the timer and the progress bar; leaving restarts it at 30% of the duration.
positiontop-left top-center top-right bottom-left bottom-center bottom-righttop-rightCorner the stack grows from; one container is kept per position.
closablebooleantrueRenders the × close button, labelled for screen readers.
iconplain text—Shown in front of the message. It is assigned as text, so markup is not parsed - pass a character like ✓.
ArekUI.toast(message, options?)method—Shows the toast and returns its element.
ArekUI.dismissToast(el)method—Closes an element returned by toast() with the exit animation.
data-ar-toast-positionattribute, written by the script—Lands on the generated container; use it as a CSS hook for a stack.