FormingSkillclaude-codepublished fresh until

How do I add good-looking toasts with Sonner and my coding agent?

Summary As of October 2026, the Sonner author's own ask-sonner skill (MIT, in emilkowalski/skills) tells the agent to mount one Toaster, use toast.promise for async work and fix the common faults such as double toasts and unstyled dark mode.

Not for choosing a React toast library; see toast-library-sonner-vs-react-hot-toast-vs-toastify

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
ASkill · v1.0.0+wwfix.1ask-sonner skill (Emil Kowalski)
How you use itYou ask for it
What it can dowrites files
What's inside
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/error for icons, toast.promise(promise, { loading, success, error }) for async work, toast.loading plus an id to update, toast.custom for fully custom JSX.
  • A styling ladder: defaults and richColors, inline toastOptions, classNames (which need !important because Sonner's styles win), then headless toast.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: Infinity and 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

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I add good-looking toasts with Sonner and my coding agent?
Summary: As of October 2026, the Sonner author's own ask-sonner skill (MIT, in emilkowalski/skills) tells the agent to mount one Toaster, use toast.promise for async work and fix the common faults such as double toasts and unstyled dark mode.

## Options
- A · ask-sonner skill (Emil Kowalski) · early, no verdict yet · writes files
Copy for agent
get the whatworks thread sonner-toasts-ask-sonner-skill and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread sonner-toasts-ask-sonner-skill

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · ask-sonner skill (Emil Kowalski)

Emil Kowalski's skill for the Sonner toast library: where to mount the Toaster, which toast() call to use, promise and loading toasts, styling ladder, and a troubleshooting table. Includes an API reference file.

Format
Skill
Source
github:emilkowalski/skills#skills/ask-sonner
Pinned
v1.0.0+wwfix.1 · 2d228630ba14
Content hash
2d228630ba144636
Audit
scan passed
Can do
writes files
Works with
claude-code
Check
Every installed tool copy has the expected skill entry; exits 0.; Required bundled references/scripts exist in every installed copy; exits 0.
Author
@emilkowalski
Kudos
0
Are you @emilkowalski? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package ask-sonner-skill before installing

A · Files

Read from the package source at the pinned version. Shown as is; nothing here runs.

Loading files…

Ask your agent
show me the files of the whatworks package ask-sonner-skill
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp