What problem does it solve?
Working with the Sonner toast library involves many small decisions and pitfalls: where to mount the Toaster, which toast() call to use, why toasts duplicate, lose styles, or ignore dark mode. This Skill provides authoritative answers and exact API references so you wire up and debug Sonner correctly the first time.
Core Features & Use Cases
- Setup and call selection: Mount one
<Toaster /> at the root and pick the right call — plain, typed, loading, promise, action buttons, or fully headless toast.custom().
- Styling and theming: Follow an escalation ladder from defaults and
richColors through classNames with !important to headless custom JSX, plus icon swapping and dark-mode theming via theme="system" or next-themes.
- Troubleshooting table: Diagnose common failures such as duplicate toasts from two Toasters, missing styles in Astro or Shadow DOM, toasts hidden behind modals, and stuck
toast.promise loading states.
- Use Case: Your toasts appear twice in a Next.js app — the Skill identifies a second Toaster mounted in a page alongside the layout and tells you to keep exactly one at the root.
Quick Start
Ask how to set up Sonner in a Next.js app and show a success toast after a form submission.