Basic usage
Dispatch thetoast event from any Livewire component:
Toast types
- Success
- Error
- Warning
- Info
- Loading
Details and footer
Add expandable detail rows and footer text:Message text
Display plain text instead of structured details:Progress toasts
Show a progress bar that updates as work completes:Use the
toast-update event to update existing toasts by ID.Undo toasts
Show a countdown with an inline undo button:event fires when the countdown expires (only if the user doesn’t click undo). You can listen for it in your Livewire component:
Persistent toasts
Create toasts that never auto-dismiss:Custom colors
Override the type color:Updating toasts
Update any toast by ID:Complete example
Here’s a Livewire component that demonstrates various toast features:Event reference
toast
toast
Dispatches a new toast notification.Parameters:
type(string) — Toast type:success,error,warning,info,loadingtitle(string) — Toast title (required)id(string) — Optional ID for updating latermessage(string) — Plain text messageavatar(string) — Avatar image URLavatarSize(string) — Avatar size (e.g.,32px)details(array) — Expandable key-value rowsfooter(string) — Footer textactions(array) — Action buttonsduration(int) — Auto-dismiss duration in millisecondspersistent(bool) — Never auto-dismisscolor(string) — Custom color (e.g.,#8b5cf6)progress(float) — Progress bar value (0 to 1)vibrate(bool|array) — Vibration pattern
toast-update
toast-update
Updates an existing toast by ID.Parameters:
id(string) — Toast ID (required)- Any property from the
toastevent
toast-undo
toast-undo
Shows an undo countdown toast.Parameters:
title(string) — Toast title (required)event(string) — Event to dispatch on countdown expiryundoEvent(string) — Event to dispatch if user clicks undodata(array) — Data to pass with eventsduration(int) — Countdown duration in millisecondstype(string) — Toast type (default:warning)