ask-sonner
emilkowalski/skills · Agent Skill
Sonner, bir React bildirim kütüphanesi rehberi - Toaster kurulumu ve bağlantısı, doğru toast() çağırma seçimi, vaat ve yük bildirimleri, güncelleme, iptal ve bildirim kaydetme, stil oluşturma, temalar ve simgeler, konumlandırma ve birden fazla Toaster. Sonner ile çalışırken veya sorunları giderirken - görünmeyen bildirimler, çift görünen bildirimler, stilleri kaybeden bildirimler, Tailwind sınıflarını yoksayan bildirimler, modal pencerenin arkasında kalan bildirimler veya karanlık tema modunu izlemeyen bildirimler.
Kuruluma geç ↓Genel bakış
| Yayıncı | |
|---|---|
| Depo | emilkowalski/skills ↗ |
| Skill klasörü | ask-sonner |
| Yıldız | 49.872 |
| Fork | 2.906 |
| Dosyalar | 2 |
| Lisans | MIT |
| Son güncelleme | 11 Ekim 2026 |
| Bağlantılar | Skill kaynağı ↗ · Depo ↗ |
Mozgi kontrolü
Skill dosyalarında bulduklarımız. Ayrıntılar abonelikle.
Kurulum
Skill, SKILL.md dosyası içeren bir klasördür. Ajanınızı seçin ve komutları proje kökünde bir terminalde çalıştırın (macOS, Linux veya Windows'ta Git Bash).
Promptu Claude, Codex veya başka bir asistana yapıştırın: skill'i inceleyip sizin için kuracaktır.
Install the “ask-sonner” skill from mozgi.io (https://mozgi.io/skills/emilkowalski-ask-sonner/) for me. 1. Download the archive: https://mozgi.io/skills/emilkowalski-ask-sonner/download If it fails, take the skill folder from the source: https://github.com/emilkowalski/skills/tree/main/skills/ask-sonner 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “ask-sonner” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/ask-sonner/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch main https://github.com/emilkowalski/skills.git /tmp/skills mkdir -p .claude/skills cp -r /tmp/skills/skills/ask-sonner .claude/skills/ask-sonner
Claude Code'u yeniden başlatın — skill listede görünür; elle çağırmak için /ask-sonner. Tüm projeler için ~/.claude/skills.
git clone --depth 1 --branch main https://github.com/emilkowalski/skills.git /tmp/skills mkdir -p .agents/skills cp -r /tmp/skills/skills/ask-sonner .agents/skills/ask-sonner
Codex skill'leri geçerli klasörden depo köküne kadar .agents/skills içinde arar; /skills veya $ask-sonner ile çağırın. Tüm projeler için ~/.agents/skills.
git clone --depth 1 --branch main https://github.com/emilkowalski/skills.git /tmp/skills mkdir -p .cursor/skills cp -r /tmp/skills/skills/ask-sonner .cursor/skills/ask-sonner
Cursor skill'i açılışta yükler; Agent sohbetinde “/” ile çağırın. Cursor .claude/skills ve .agents/skills klasörlerini de okur. Tüm projeler için ~/.cursor/skills.
git clone --depth 1 --branch main https://github.com/emilkowalski/skills.git /tmp/skills mkdir -p .gemini/skills cp -r /tmp/skills/skills/ask-sonner .gemini/skills/ask-sonner
Gemini CLI, görev uyduğunda skill'i etkinleştirmeyi önerir — siz onaylarsınız. Tüm projeler için ~/.gemini/skills.
Kurulumdan önce SKILL.md ve eşlik eden dosyaları inceleyin. Önizleme için dosyaya tıklayın.
SKILL.md içeriği
Yazarın orijinal metni · salt okunurWorking 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:
1. 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.
2. 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
Picking 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.
1. Defaults — plus richColors on the Toaster for colorful success/error, invert to flip against the theme.
2. Inline tweaks — toastOptions={{ style: {…} }} on the Toaster for all toasts, or style per toast() call.
3. 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.
4. 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.
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. |
Sık sorulan sorular
ask-sonner skill'i ne yapar?
Sonner, bir React bildirim kütüphanesi rehberi - Toaster kurulumu ve bağlantısı, doğru toast() çağırma seçimi, vaat ve yük bildirimleri, güncelleme, iptal ve bildirim kaydetme, stil oluşturma, temalar ve simgeler, konumlandırma ve birden fazla Toaster. Sonner ile çalışırken veya sorunları giderirken - görünmeyen bildirimler, çift görünen bildirimler, stilleri kaybeden bildirimler, Tailwind sınıflarını yoksayan bildirimler, modal pencerenin arkasında kalan bildirimler veya karanlık tema modunu izlemeyen bildirimler.
ask-sonner nasıl kurulur?
Bu sayfadaki “Kurulum” bölümünü açın ve ajanınızı seçin — Claude Code, Codex, Cursor veya Gemini CLI: skill klasörünü doğru yere kopyalayan hazır komutlar orada. Ya da “Asistanla” sekmesindeki promptu kopyalayın; asistan skill'i inceleyip kuracaktır.
ask-sonner hangi yapay zekâlarla çalışır?
Skill'ler düz Markdown talimatlarıdır (Agent Skills formatı), bu yüzden ask-sonner SKILL.md okuyan her ajanla çalışır: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode ve diğerleri. Model talimatları yalnızca görev skill açıklamasına uyduğunda yükler.
ask-sonner ücretsiz mi?
Skill, emilkowalski tarafından açık olarak yayımlandı (MIT lisansı). Skill'in kendisi ücretsizdir — yalnızca kullandığınız token'lar için yapay zekâ sağlayıcınıza ödeme yaparsınız.
Skill kurmak güvenli mi?
Skill, ajanınızın izleyeceği talimatlardır; kurmadan önce SKILL.md ve eşlik eden dosyaları okuyun. Skill klasöründeki betikler yalnızca ajanınız çalıştırırsa çalışır — ne yaptığını izleyin ve gereksiz izin vermeyin.
Skill, MCP sunucusu veya eklentiden nasıl farklıdır?
MCP sunucusu veya eklenti modele yeni araçlar verir — çalışıp sonuç döndüren kod. Skill ise bilgi ve süreç verir: göreve nasıl yaklaşılacağı, hangi adımların izleneceği ve iyi sonucun neye benzediği. Sunucu veya API anahtarı gerekmez.