Override the default duration for individual toasts.
PHP Facade
PHP Helper
Vue 3
React
Copy
use InertiaToast\Facades\Toast;// Quick notification (3 seconds)Toast::success('Saved!', duration: 3000);// Important warning (10 seconds)Toast::warning('Your session is about to expire.', duration: 10000);// With title and custom durationToast::error( 'Failed to process payment.', title: 'Payment Error', duration: 8000);
Copy
// Using the fluent helpertoast('Quick message')->duration(3000)->success();toast('Read this carefully') ->duration(10000) ->warning();toast('Operation failed') ->title('Error') ->duration(8000) ->error();
Copy
<script setup>import { useToast } from '@laravel-inertia-toast/vue'const { success, error, warning } = useToast()function handleCopy() { success('Copied to clipboard!', { duration: 2000 })}function handleWarning() { warning('Your session is about to expire.', { title: 'Warning', duration: 10000 })}</script>
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.