The OdinAdmin template has just been developed — explore the new dashboard, modules and settings. See Details
Toast Builderpick the options, then show it
Type
0 = stays until closed
Behaviour
Code

The call for the toast on the left. Options that keep their default are left out.


              

Change a default once for the whole admin: Odin.Toast.defaults.position = 'bottom-right'.

TypesOdin.toast.success(text, title)

A shortcut for every colour. error is the same as danger.

Positionsposition: 'top-right'

Six places on the screen. Each one keeps its own stack.

Behaviour
Stays until closed — timeout: 0
Clickable — onClick + closeOnClick
No duplicates — preventDuplicates: true (click several times)
Close from code — toast.close(), Odin.toast.clear()
OptionsOdin.Toast.defaults
OptionDefaultWhat it does
type'primary'success, info, warning, danger (or error), primary, light, dark
title, text''Plain text — it is never read as HTML
iconby typeAny Font Awesome class, e.g. 'fas fa-cloud'
timeout5000Milliseconds before it closes; 0 keeps it open. Hover pauses the timer
position'top-right'top-right, top-center, top-left, bottom-right, bottom-center, bottom-left
closeButtontrueShow the × button
progressBartrueShow the line that counts down the time
newestOnToptrueNew toasts appear nearest the edge of the screen
preventDuplicatesfalseSkip a toast with the same type, title and text that is still open
closeOnClickfalseClicking the toast closes it
onClicknulltoast => … runs when the toast is clicked