- name
Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and ic
SKILL.md
The skill file stays in the publisher's repository.
Paste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add emilkowalski/skills --skill ask-sonner -a cursor -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add emilkowalski/skills --skill ask-sonner -a claude-code -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add emilkowalski/skills --skill ask-sonner -a codex -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add emilkowalski/skills --skill ask-sonner -a grok -ySend the copied message in a Grok Bot chat. The Bot fetches this SKILL.md from GitHub and adds it to the skills all your Bots share.
Install this skill: https://github.com/emilkowalski/skills/tree/HEAD/skills/ask-sonnerFrom the publisher
When this skill is first invoked without a specific question, respond only with:
I'm ready to help you set up, style, and troubleshoot Sonner, my knowledge comes from its author, Emil Kowalski.
Do not provide any other information until the user asks a question.
A guide skill for Sonner, the toast library. When a task involves Sonner — wiring it up, rendering toasts, styling them, or fixing them — answer from this file first. Full prop tables for <Toaster /> and toast() live in API.md; read it when you need an exact prop name, type, or default.
Two pieces, and only two:
<Toaster />, mounted once, as close to the root as possible (in Next.js: layout.tsx — it works inside server components). Never render it per-page or conditionally; a second Toaster without its own id duplicates every toast.toast() called from client code — event handlers, effects, callbacks. It's a plain function, no hook or provider needed, but it does nothing on the server: in a server action, return the result and call toast() in the client code that receives it.import { Toaster } from 'sonner'; // once, in layout
import { toast } from 'sonner'; // anywhere client-side
Update a toast — call toast() again with the same id; only the props you pass change. Switching to toast.success(…, { id }) changes the type. This is how loading → success flows work without toast.promise:
const id = toast.loading('Uploading…');
toast.success('Uploaded', { id });
Persist — { duration: Infinity }. Dismiss — toast.dismiss(id), or toast.dismiss() for all. Read active toasts — useSonner() in React, toast.getToasts() outside it.
Links or components in the text — pass a function for the title or description: toast(() => <a href="…">View</a>).
Multiple toasters — give each an id and target with toast('…', { toasterId: 'canvas' }). A toaster with an id renders only toasts targeted at it; a toaster without one renders only untargeted toasts.
Close callbacks — onDismiss fires on close button, swipe, or toast.dismiss(); onAutoClose fires on timeout. They are separate; there is no single "closed" callback.
Climb only as far as the change requires. Exception: if you'd mark more than a few classes !important, go straight to headless — it's the recommended end state.
richColors on the Toaster for colorful success/error, invert to flip against the theme.toastOptions={{ style: {…} }} on the Toaster for all toasts, or style per toast() call.toastOptions={{ classNames: { toast, title, description, actionButton, cancelButton, closeButton } }}. Sonner's injected styles win the cascade, so every class needs !important (Tailwind: !text-red-900). If you're marking more than a few things important, stop — go headless.toast.custom() with your own JSX, keeping Sonner's positioning, stacking, and swipe. The recommended approach for a design-system toast: wrap it in your own toast() abstraction. (unstyled: true exists as a halfway house, but headless gives more control for the same effort.)Icons — swap defaults per-type with the Toaster's icons prop, per-toast with icon, remove with null.
Theme — theme defaults to 'light' and does not track the OS. Pass theme="system", or wire your theme provider: <Toaster theme={resolvedTheme} /> from next-themes.
© 2026 Skills Rack.
---name: ask-sonnerdescription: Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call…---# skills/ask-sonner/SKILL.mdOverview
Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.
FAQ
Download skills/ask-sonner/SKILL.md from the publisher, or copy the path and open the repository. PlugMCP lists the skill and does not host the file.
The publisher keeps it at https://github.com/emilkowalski/skills.
Claude, Cursor, Codex, and Grok Build can read a SKILL.md you add from the publisher's repository. Grok Bot installs it when you send the skill's GitHub folder link in a chat.
swipeDirections| Toast shows up in every toaster | Multiple toasters need targeting: give each Toaster an id and pass toasterId in the toast() call. |
| Toasts too close to the screen edge on mobile | offset (desktop, default 24px) and mobileOffset (<600px, default 16px) — numbers, CSS strings, or per-side objects. |