Skip to main content
DeployStack uses Sonner for toast notifications, providing elegant and accessible notifications across the entire application. The system is globally configured and requires no additional setup in individual components.

Architecture Overview

The global Sonner toaster is configured in App.vue as the root-level toast provider:
This setup ensures toasts are displayed consistently across all routes and components without requiring local toast providers.

Basic Usage

Importing and Using Toasts

Toast with Description

Real-World Examples

API Success/Error Handling

Form Validation Feedback

Async Operations with Loading States

Advanced Usage

Custom Duration

Action Buttons

Custom Styling

Integration with Internationalization

Combine Sonner with the i18n system for localized messages:

Event Bus Integration

Sonner works seamlessly with the global event bus:

Best Practices

1. Use Appropriate Toast Types

2. Provide Meaningful Descriptions

3. Handle Loading States

4. Avoid Toast Spam

Common Pitfalls

❌ Don’t Add Multiple Toasters

The global Toaster in App.vue handles all notifications automatically.

❌ Don’t Overuse Toasts

❌ Don’t Forget Error Handling

Testing Toasts

Unit Testing

Migration from Other Toast Systems

From Vue-Toastification

From Custom Alert Components

The global Sonner system provides a consistent, accessible, and developer-friendly way to handle notifications across the entire DeployStack application.