ask-sonner

Guides setup, styling, and troubleshooting of Sonner toast notifications in React applications.

Updated Jul 14, 2026
One-click install
npx skills add https://github.com/quanthubbr/tron-claude-config --skill ask-sonner-quanthubbr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ask-sonner
Source: https://github.com/quanthubbr/tron-claude-config/tree/main/managed/skills/emilkowalski/ask-sonner
Command: npx skills add https://github.com/quanthubbr/tron-claude-config --skill ask-sonner-quanthubbr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sonner.

What problem does it solve? Sonner toasts often fail in confusing ways: they never appear, render twice, ignore Tailwind classes, hide behind modals, or ignore dark mode. This Skill provides authoritative guidance from Sonner's author for wiring up the Toaster correctly, choosing the right toast() call, and diagnosing every common failure mode. ## Core Features & Use Cases - Setup and call selection: Mount one <Toaster /> at the root and pick the correct API — typed toasts, toast.loading, toast.promise, action buttons, or headless toast.custom. - Styling escalation ladder: Progress from defaults and richColors through inline styles and classNames (with !important) to fully headless custom JSX for design-system toasts. - Troubleshooting table: Maps symptoms like duplicate toasts, lost styles in Astro, Shadow DOM issues, stacking-context clipping, and stuck toast.promise loaders to concrete fixes. - Use Case: Your toast renders behind a modal in a Next.js app. The Skill identifies the ancestor stacking context as the cause and directs you to move <Toaster /> to the document root outside any portal container. ## Quick Start Ask how to set up Sonner in a Next.js app or describe the toast problem you are seeing, such as toasts appearing twice or ignoring dark mode.

Frequently Asked Questions about ask-sonner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Sonner toasts in a Next.js app?▼

Mount a single `<Toaster />` in your root layout.tsx — it works inside server components — and call `toast()` from client code like event handlers. Never render the Toaster per-page or conditionally, since a second mounted Toaster duplicates every toast.

How do I show a loading toast that becomes a success toast in Sonner?▼

Use `toast.promise(promise, { loading, success, error })` to tie the toast lifecycle to a promise, or manage it manually: store the id from `toast.loading('Uploading…')` and later call `toast.success('Uploaded', { id })` to update the same toast.

Why do my Sonner toasts appear twice in React?▼

Duplicate toasts come from two mounted Toasters (layout and page) or from calling `toast()` inside an effect under React StrictMode's dev double-invoke. Keep one Toaster and fire toasts from event handlers, or pass a stable id so the second call updates instead.

Why do Tailwind classes have no effect on Sonner toasts?▼

Sonner's injected default styles win the cascade over utility classes. Mark classes `!important` (e.g. `!text-red-900`), or use `unstyled: true` or headless `toast.custom()` with your own JSX for full control.

Does Sonner follow system dark mode automatically?▼

No. The `theme` prop defaults to `'light'` and does not track the OS. Pass `theme="system"` on the Toaster, or wire your theme provider, for example `<Toaster theme={resolvedTheme} />` from next-themes.

Why is my Sonner toast stuck on loading forever?▼

A `toast.promise` toast waits until its promise settles, so a promise that never resolves or rejects leaves the loading state permanently. Also check for `duration: Infinity` or `dismissible: false` on manually created toasts.