Installation
TheInertiaToast plugin must be installed in your Vue application to enable toast notifications. It automatically listens for Inertia flash messages and displays them as toasts.
Configuration options
All configuration options are optional. The plugin will use default values if not specified.Duration in milliseconds before a toast automatically closes. Set to
0 to disable auto-close.Position where toasts appear on the screen.Valid values:
top-lefttop-centertop-rightbottom-leftbottom-centerbottom-right
Maximum number of toasts visible at once. Older toasts are removed when this limit is exceeded.
The flash message key to look for in Inertia responses. Must match the key used in your Laravel backend.
TypeScript types
How it works
The plugin automatically:- Configures the global toast settings based on provided options
- Listens for Inertia’s
flashevent on the router - Extracts toast messages from flash data using the configured
propKey - Adds each toast message to the internal store for display
The plugin only runs in browser environments. It safely returns early during server-side rendering.