Components

The Toast components include the following:

  • Toast - Container for toast notifications with channel and alignment support.
  • useToast - Composable for global toast notification management with channel support.
  • clearAllToastQueues - Clears all toast queues for all channels.

Toast

The Toast component is a flexible container for displaying notification toasts. It receives toasts from the useToast composable and renders each toast using its default slot. The component supports named channels (via the name prop), customizable default settings for each channel, and a full range of horizontal and vertical alignment options. Each toast is passed to the slot with its data and a removeToast callback for dismissal.

useToast

The useToast composable offers a flexible, channel-based toast notification system. Each toast channel manages its own state, queue, and configuration. Toasts can be added, removed, updated, and queued, with full support for asynchronous flows (e.g., promise toasts). Defaults can be set per channel, and all state is fully reactive for seamless UI updates.

clearAllToastQueues

The clearAllToastQueues function clears all queued toasts across every channel. Useful for global state resets (e.g., logout).