Command Palette

Search for a command to run...

Назад к скиллам
скилл № 36075

ask-sonner

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…

БесплатноБез исполняемых скриптов
Asymmetric-alот Asymmetric-al★ 354 звезды на GitHub

Установить ask-sonner в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Working With Sonner

This repository (Asymmetric-al/core)

Core already ships a Sonner toaster through @asym/ui. Use this skill to operate that existing setup, not to mount a second toaster. Reconcile this overlay after upstream refreshes before running bun run skills:sync.

Triggers

  • Toast copy, variants, promise/loading toasts, positioning, or Sonner API questions in this repo.
  • Do not install a second sonner tree or add another <Toaster />.

Workflow

  1. Reuse packages/ui/components/shadcn/sonner.tsx and the @asym/ui / @asym/ui/components/shadcn re-exports.
  2. Import toast from sonner the same way existing UI files do.
  3. Keep theme, tokens, and layout ownership in Core's design system.
  4. After overlay or toaster-host refreshes, run bun run skills:sync and bun run skills:verify.

Checklist

  • No second <Toaster /> is mounted.
  • The existing @asym/ui toaster is the only host.
  • Skill mirrors stayed in sync (bun run skills:verify).

When invoked without a concrete task, briefly ask for the objective. If a task or question is already present, continue its workflow immediately.

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. Do not mount a Toaster. Core layouts already mount @asym/ui's <Toaster /> once. Reuse that host. 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 "@asym/ui/components/shadcn/sonner"; // already mounted in Core layouts
import { toast } from "sonner"; // anywhere client-side

Do not import <Toaster /> from sonner and do not mount a second toaster.

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.getToasts() outside it.

Links or components in the text — pass a function for the title or description: toast(() => <a href="…">View</a>).

One toaster — Core mounts a single @asym/ui <Toaster />. Do not add a second host.

Close callbacks — onDismiss fires on close button, swipe, or toast.dismiss(); 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. Exception: if you'd mark more than a few classes !important, go straight to headless — it's the rec

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • API.md
  • references/LICENSE.md
  • references/upstream.md

FAQ

Что делает скилл ask-sonner?

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.

Как установить скилл ask-sonner?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ask-sonner запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ask-sonner с