ask-sonner
Skill1 starsChanged 8 days agoMITView on GitHub
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.
31 other projects use a version of this, 17 of them edited; 2 new projects in the last 4 weeks, against 1 the 4 before.
Adopted by
Rising: 2 new projects took it in the last 4 weeks, 2× the 4 weeks before.thin data
Most recently taken up by
- alunadev/ald-skillsedited, first seen Nov 8, 2026
- Tresnanda/kybernedited, first seen Nov 8, 2026
- leepokai/Codyncword for word, first seen Nov 4, 2026
- HackIndiaXYZ/ai-first-startup-hackathon-build-a-startup-using-ai-only-arclightword for word, first seen Nov 1, 2026
- LuanRoger/next-dxword for word, first seen Nov 1, 2026
- robinbril/claude-code-harnessword for word, first seen Nov 1, 2026
Used with
Projects with it also use brandkit, design-taste-frontend-v1 and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnasX7Skillbrandkit
Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts.
Also in 6 projects that use this
HK-hubSkilldesign-taste-frontend-v1
The original v1 taste-skill, preserved for projects depending on its exact behavior. The current default is `design-taste-frontend` (v2 experimental), which is a substantial rewrite. Use this v1 install name only if you need exact backward compatibility.
Also in 4 projects that use this
OpenAISkillimage-to-code
Implement a selected image, screenshot, mockup, or Image Gen reference as a faithful, responsive frontend.
Also in 6 projects that use this
AnasX7Skillimagegen-frontend-mobile
Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured surfaces, image-led composition, tasteful custom iconography, and clean phone mockup framing. By default, screens should be shown inside a subtle premium iPhone or similar phone mockup with a visible frame, while the main focus stays on the app content itself. This skill generates images only. It does not write code.
Also in 4 projects that use this
HK-hubSkillstitch-design-taste
Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.
Also in 4 projects that use this
- +7 more from AnasX7
Other versions31 projects use a version of this.
Word for word · 13
- emilkowalski/skill★ 55k100% same
- emilkowalski/skills★ 55k100% same
- leepokai/Codync★ 2k100% same
- anis-dr/skills★ 3100% same
- robinbril/claude-code-harness★ 3100% same
- jasonfesta/design-agents★ 1100% same
- LuanRoger/next-dx★ 1100% same
- Vroind-ausm-All/Claude-Skills★ 1100% same
- aipphilie/claude-skills★ 0100% same
- HackIndiaXYZ/ai-first-startup-hackathon-build-a-startup-using-ai-only-arclight★ 0100% same
3 more not listed
Edited · 17
- Tresnanda/kybern★ 83100% same
- kv0906/cc-skills★ 4291% same
- alunadev/ald-skills★ 493% same
- idexal/idexal-skills★ 2100% same
- ReyYang/SkillYard★ 2100% same
- sanmidable/skills★ 298% same
- sid-lakhani/agents-config★ 2100% same
- bhubbard/skills★ 1100% same
- beelabstudio/ai★ 099% same
- Elrudsl/claude-skills★ 0100% same
7 more not listed
Wrote their own version · 1
- malinskibeniamin/skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/apple-design-hig/AGENTS.mdAGENTS.md
- animate-expoSkill
- animateSkill
- animation-performanceSkill
- animation-vocabularySkill
- apple-design-higSkill
- apple-designSkill
- break-uiSkill
- emil-design-engSkill
- find-animation-opportunitiesSkill
- improve-animationsSkill
- mobile-nativeSkill
- pick-ui-librarySkill
- prototypeSkill
- remove-animationsSkill
- review-animationsSkill
- write-swiftSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
When this skill is first invoked without a specific question, respond only with:
- Distinctive: line 14
Do not provide any other information until the user asks a question.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Working With Sonner
Initial Response
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.
Setup
Two pieces, and only two:
- One
<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 mounted Toaster 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 calltoast()in the client code that receives it.
import { Toaster } from 'sonner'; // once, in layout
import { toast } from 'sonner'; // anywhere client-sidePicking the right call
| You want | Call |
| Plain message | toast('Title') — add { description } for a second line |
| Success / error / info / warning icon | toast.success('…'), toast.error('…'), etc. |
| Spinner while you manage state yourself | toast.loading('…'), then update it by id |
| Loading → success/error tied to a promise | toast.promise(promise, { loading, success, error }) — success/error accept functions receiving the resolved value/error |
| Button that does something | { action: { label, onClick } } — closes the toast unless onClick calls event.preventDefault(); cancel is the secondary variant |
| Custom JSX, default toast shell | toast(<jsx />) |
| Custom JSX, no styles at all | toast.custom((t) => <jsx />) — headless, t gives you the id to dismiss |
Recipes
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.getActiveToasts() 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' }). Without toasterId, every toaster renders the toast.
Close callbacks — onDismiss fires on close button or swipe; onAutoClose fires on timeout. They are separate; there is no single "closed" callback.
Styling — the escalation ladder
Climb only as far as the change requires; jumping to the top rung too early is fine (it's the recommended end state), lingering in the middle is not.
- Defaults — plus
richColorson the Toaster for colorful success/error,invertto flip against the theme. - Inline tweaks —
toastOptions={{ style: {…} }}on the Toaster for all toasts, orstylepertoast()call. - Classes on parts —
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. - 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 owntoast()abstraction. (unstyled: trueexists 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.
Troubleshooting
| Symptom | Cause → fix |
| Toast never appears | No <Toaster /> mounted, or it unmounted (conditional render, per-page placement). Mount one at the root. If calling from a server action: toast() is client-only — call it with the action's result on the client. |
| Same toast appears twice | Two Toasters mounted (layout and page) — keep one. Or toast() fired in an effect under React StrictMode's dev double-invoke — fire from the event handler instead, or pass a stable id so the second call updates rather than duplicates. |
| Tailwind/CSS classes have no effect | Default styles override them. Mark them !important, or use unstyled / headless (see the ladder above). |
| Toasts render completely unstyled (common in Astro, view transitions) | Sonner's injected stylesheet was lost — import it explicitly in a layout: import 'sonner/dist/styles.css'. |
| Unstyled inside Shadow DOM | Styles land in document.head, not the shadow root. Copy the style tag whose text includes [data-sonner-toaster] into the shadow root. |
| Toast behind a modal/overlay, or clipped | An ancestor creates a stacking context (transform, filter, overflow) or the overlay out-z-indexes the toaster. Move <Toaster /> to the document root, outside any dialog/portal container. |
| Dark mode ignored | theme defaults to 'light' — set theme="system" or pass the resolved theme (see Theme above). |
| Success/error look gray, not green/red | That's the default. Add richColors to the Toaster. |
| Toast never closes | duration: Infinity, dismissible: false, or a toast.promise whose promise never settles — the loading toast waits forever. |
toast.promise stuck on loading | It needs a promise (or a function returning one) as its first argument, and the promise must actually resolve/reject. |
| Swipe-to-dismiss goes the wrong way / doesn't work | Directions derive from position. Override with swipeDirections on the Toaster. |
| 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 32px) and mobileOffset (<600px, default 16px) — numbers, CSS strings, or per-side objects. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

