Duration settings
Control how long toasts remain visible before automatically dismissing.Default duration
Set the default duration for all toasts in your application.- PHP (Backend)
- Vue 3 (Frontend)
- React (Frontend)
Configure the default duration in the config file:
config/inertia-toast.php
Per-toast duration
Override the default duration for individual toasts.- PHP Facade
- PHP Helper
- Vue 3
- React
Duration is specified in milliseconds. For example, 3000 = 3 seconds, 5000 = 5 seconds, 10000 = 10 seconds.
Max visible toasts
Limit the number of toasts that can be displayed simultaneously on screen.- PHP (Backend)
- Vue 3 (Frontend)
- React (Frontend)
config/inertia-toast.php
Inertia flash key
Customize the key used for flashing toast data through Inertia.js.config/inertia-toast.php
prop_key setting determines the Inertia flash key name. You typically only need to change this if:
- You already use a prop named
toastsin your Inertia shared data - You want to namespace the toast data differently
- You’re integrating with an existing notification system
Configuration hierarchy
When the same setting is configured in multiple places, the following priority order applies:- Per-toast options (highest priority) -
Toast::success('...', duration: 3000) - Frontend configuration - Plugin/Provider config in
app.js/app.tsx - Backend configuration (lowest priority) -
config/inertia-toast.php
Duration recommendations
Choose appropriate durations based on the toast type and message length:- Success messages - 3000-5000ms (3-5 seconds)
- Error messages - 7000-10000ms (7-10 seconds) - Users need time to read error details
- Info messages - 5000ms (5 seconds)
- Warning messages - 7000-10000ms (7-10 seconds) - Important warnings need attention
- Long messages - Add 1000ms for every 10-15 additional words
Users can manually dismiss toasts at any time by clicking the close button, so don’t worry too much about the exact duration - err on the side of giving users more time to read.