---
name: "sonner-toast-notifications"
description: "Display stackable, beautiful toast alerts with action buttons and promise state handling."
metadata:
  author: "Emil Kowalski"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "show toast with sonner"
  - "toast promise async sonner"
  - "custom action button toast sonner"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Sonner Opinionated Toast Notification System

Configures Sonner: placing <Toaster /> provider, dispatching toasts (toast.success, toast.error), toast.promise for async API calls, expandable multi-toast stacks, rich colors, and custom action buttons.

## When to Invoke
Invoke this skill whenever you need to:
- show toast with sonner
- toast promise async sonner
- custom action button toast sonner

## Execution SOP & Rules
1. Add <Toaster richColors position='top-right' /> at application root layout.
2. Trigger simple alerts: toast.success('Profile updated successfully').
3. Handle async promises: toast.promise(saveData(), { loading: 'Saving...', success: 'Saved!', error: 'Failed' }).
4. Attach action callback: toast('Item deleted', { action: { label: 'Undo', onClick: () => restoreItem() } }).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
