- How you use it
- You ask for it
- What it can do
- writes files
- What's inside
The option
| Option | ASkill · v1.0.0+wwfix.1ask-sonner skill (Emil Kowalski) |
|---|---|
| How you use it | You ask for it |
| What it can do | writes files |
| What's inside |
What this thread does
The problem
Agents add toasts in inconsistent ways: a Toaster per page, toasts fired from server actions, classes that do nothing, success messages that look gray. Sonner is the common choice (MIT and the toast component shadcn/ui documents), but the agent has to use it correctly.
What the package is
Emil Kowalski, Sonner's author, publishes a skill for it in emilkowalski/skills (MIT, locked to commit 2d22863 for this entry). The Sonner README itself points to it. Rules I read in the SKILL.md:
- One
<Toaster />, mounted once at the root (in Next.js,layout.tsx). A second Toaster duplicates every toast.toast()is client-side only; from a server action, return the result and toast in the client code. - Picking the call:
toast.success/errorfor icons,toast.promise(promise, { loading, success, error })for async work,toast.loadingplus anidto update,toast.customfor fully custom JSX. - A styling ladder: defaults and
richColors, inlinetoastOptions,classNames(which need!importantbecause Sonner's styles win), then headlesstoast.custom. - Theme defaults to light; pass
theme="system"or your resolved theme for dark mode. - A troubleshooting table: no toast (no Toaster mounted), double toast (two Toasters or StrictMode effect), unstyled in Astro (import the stylesheet), clipped behind a modal (move the Toaster to the root).
How to describe it to the agent
A prompt worth trying (mine): "Use the ask-sonner skill. Add one Toaster in the root layout with theme following our theme provider and richColors. Replace every alert() and console-only error with toast.success, toast.error or toast.promise. Keep messages to one short line with an optional description."
Common mistakes
- Toasts for things that need to stay visible (a commenter in an r/reactjs thread on the best toaster library warned that a toast is a common UX trap). Errors the user must act on belong inline.
- Mixing two toast libraries.
- Using
duration: Infinityand never dismissing.
Alternatives
See the toast library comparison thread for react-hot-toast, react-toastify and Base UI Toast. As of October 2026 the same author's pick-ui-library skill also lists Sonner for toasts.
Limits
I read the skill, not outputs from it. Prompt wording is mine and untried.
Primary source
Primary source: ask-sonner SKILL.md (Emil Kowalski, commit 2d22863). Checked in the file: one Toaster at the root, toast() client-only, the call-picking table, the styling ladder with important-marked classes, theme defaulting to light, and the troubleshooting rows (no toast, double toast under StrictMode, Astro stylesheet import, clipped behind a modal). Not verified: the star counts, the licence text and the Reddit comment.
Started from a post by @Emil Kowalski, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.