ToastLevel
TypeScript type representing the severity level of a toast notification.ToastLevel enum values. See the Enums page for more details.
ToastMessage
Represents a single toast notification message with its properties.Properties
The severity level of the toast. Must be one of:
'success', 'error', 'info', or 'warning'.Custom duration in milliseconds for this specific toast. If
null, uses the default duration from ToastConfig.Source
Usage example
ToastItem
ExtendsToastMessage with a unique identifier. Used internally by the Toaster component to track individual toasts.
Properties
Inherits all properties fromToastMessage:
Source
Usage example
You typically don’t need to create
ToastItem objects manually. The Toaster component automatically generates IDs for incoming ToastMessage objects.ToastConfig
Configuration object for the Toaster component. Defines global settings for toast behavior and appearance.Properties
Default duration in milliseconds for all toasts. Can be overridden per toast using
ToastMessage.duration.Default: 3000Screen position where toasts appear. Must be one of:
'top-right', 'top-left', 'top-center', 'bottom-right', 'bottom-left', or 'bottom-center'.Default: 'top-right'Maximum number of toasts that can be visible simultaneously. Older toasts are dismissed when the limit is reached.Default:
3The Inertia prop key used to receive toast messages from the backend.Default:
'toasts'Source
Usage examples
The configuration values are set in
config/inertia-toast.php and automatically passed to the frontend. You can override them by passing props to the Toaster component.Type locations
Both Vue and React packages share identical TypeScript interfaces:- Vue:
@inertiatoast/vue/src/types.ts - React:
@inertiatoast/react/src/types.ts