Toast

Organism

Notification system with success/warning/error/info/loading variants. Hover-to-freeze, progress bar, title, actions, and promise support.

Success

Preview

File uploaded

report.pdf has been uploaded successfully.

Code
<%- include('modules/ui/Toast', {
  variant: 'success',
  title: 'File uploaded',
  message: 'report.pdf has been uploaded successfully.'
}) %>

Error

Preview

Upload failed

The file exceeds the 10 MB size limit.

Code
<%- include('modules/ui/Toast', {
  variant: 'error',
  title: 'Upload failed',
  message: 'The file exceeds the 10 MB size limit.',
  actionLabel: 'Try again'
}) %>

Warning

Preview

Session expires in 5 minutes.

Code
<%- include('modules/ui/Toast', {
  variant: 'warning',
  message: 'Session expires in 5 minutes.'
}) %>

Info

Preview

New update

Version 2.4 is available. Refresh to apply.

Code
<%- include('modules/ui/Toast', {
  variant: 'info',
  title: 'New update',
  message: 'Version 2.4 is available. Refresh to apply.'
}) %>

Loading

Preview

Saving your changes…

Code
<%- include('modules/ui/Toast', {
  variant: 'loading',
  message: 'Saving your changes…',
  persistent: true
}) %>

toast.promise() API

Preview

Kullanıcı yükleniyor…

Code
<%# Mount once — store.js exposes window.toast() %>
<%- include('modules/ui/Toast/scripts/store.js') %>

Source modules/ui/Toast/Toast.ejs