sonner

Configure Sonner toast notifications for React async operations.

1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/antonyfmunoz/OS --skill sonner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sonner
Source: https://github.com/antonyfmunoz/OS/tree/main/skills/tools/sonner
Command: npx skills add https://github.com/antonyfmunoz/OS --skill sonner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill removes the friction of manual UI status handling by helping you add, debug, and standardize toast notifications so users always get clear success/error/loading feedback during operations.

Core Features & Use Cases

  • Global, hook-free toast UX: Mount <Toaster /> once and trigger toast.* from anywhere, including mutation callbacks and error handlers.
  • Promise and lifecycle feedback: Use toast.promise(...) to convert async operations into consistent loading→success/error flows.
  • Progress, dedupe, and updates: Use stable id values to update a single toast (e.g., progress and retries) instead of spamming the user.
  • React Query integration pattern: Wire MutationCache / QueryCache global onError to show default error toasts with minimal boilerplate.
  • Shadcn/ui + theme wiring: Place Sonner’s <Toaster /> at the correct root location and apply theme/richColors/classNames without common footguns.

Quick Start

Add a single root <Toaster /> to your app, then replace your scattered success/error UI with toast.promise(mutation.mutateAsync(...), { loading, success, error }) for each async action.

Frequently Asked Questions about sonner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I show toast notifications for async operations in a shadcn/ui app?

Toast notifications for async operations are displayed by mounting a single root `<Toaster />` component and using `toast.promise` to convert mutation callbacks into loading, success, and error feedback states.

How do I prevent duplicate React toast notifications during retries?

Duplicate React toast notifications during retries are prevented by assigning stable toast IDs, which deduplicate messages and update a single existing toast's progress instead of stacking multiple instances.

Can I use TanStack Query MutationCache to trigger global error toasts?

TanStack Query MutationCache can trigger global error toasts by wiring the `onError` callback within `MutationCache` or `QueryCache`, providing default error UI feedback with minimal boilerplate.

Does Sonner require hooks to trigger toast messages from anywhere?

Sonner does not require hooks to trigger toast messages; it provides a global, hook-free toast UX where you mount `<Toaster />` once and call `toast.*` methods from anywhere, including mutation callbacks.

What is the best way to wire a React toast theme with shadcn/ui?

The best way to wire a React toast theme with shadcn/ui is placing the `<Toaster />` at the correct root location and applying theme, richColors, and classNames properties directly to avoid common configuration footguns.