Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Sonner

Opinionated toast notification component for React applications.

UI components and iconsNPM

GitHubWebsite

1. License

License from npm.

github.com/emilkowalski/sonner

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Sonner does

Sonner is built around its defaults: it calls itself "opinionated", a builder picked it because it looks good and stacks sensibly with no configuration, and Supabase's design system turns that styling off with <code>unstyled: true</code> to apply its own.

Sonner popularity

82 / 100
Gid Score, #71 overall
61.9M
downloads a week, npm
13.3K
GitHub stars
584
agent projects use it
Sonner: downloads per weeknpm, sonner 61,893,599
Sonner: GitHub starsemilkowalski/sonner 13,262

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Sonner is used

  • Sonner is a dependency in 584 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (12.0% of the 4,867 JavaScript/TypeScript ones), #4 of 230 in ui components and icons.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 2,401; those are left out of every share on this page.
  • The most used alternative in our scan is React Hot Toast (76 projects).
  • Projects that use it most often also use Lucide React (96.4%), clsx (95.7%), Tailwind Merge (95.4%).
  • It is more common in projects set up for Kiro (13.6%) than for Gemini CLI (7.2%).

By coding agent

303 projects, 12.4%
293 projects, 8.9%
260 projects, 8.6%
36 projects, 7.7%
34 projects, 7.2%
33 projects, 11.8%
28 projects, 8.2%
19 projects, 13.6%

Often used with

In 96.4% of its projects
In 95.7% of its projects
In 95.4% of its projects
In 94.2% of its projects
In 79.3% of its projects
In 99.8% of its projects
In 99.7% of its projects
In 75.5% of its projects

Sonner in practice

Strengths

No provider to wrap the app in

peal.dev describes setup as two lines: add the Toaster once, then call <code>toast()</code> anywhere. They point out there are no context providers and nothing to wrap around the app.

Toaster can sit in a server component

The getting-started docs say the Toaster can be placed anywhere. That includes a Next.js <code>layout.tsx</code> that is a server component.

One toast for a whole promise

peal.dev says <code>toast.promise()</code> is the variant they use most. It handles the loading, success and error states and updates the same toast instead of showing three separate ones.

Swipe follows position

The <code>position</code> prop takes six values, from <code>top-left</code> to <code>bottom-right</code>. The site notes that the swipe direction changes with the position you choose.

Watch out for

Server Actions cannot fire toasts

In the Next.js App Router, Server Actions run on the server and cannot call <code>toast()</code>. peal.dev returns a result from the action and fires the toast in a client component.

Heavy custom designs fit less well

peal.dev writes that toasts needing heavy styling outside Sonner's design system, or fully custom JSX in each toast, get more room in React Hot Toast.

Rapid clicks still need debouncing

peal.dev says Sonner "handles this somewhat" when someone clicks submit several times. In their view, you still need to debounce the action itself.

Mount the Toaster and fire a toast

import { Toaster, toast } from 'sonner';

// ...

function App() {
  return (
    <div>
      <Toaster />
      <button onClick={() => toast('My first toast')}>Give me a toast</button>
    </div>
  );
}

More about Sonner

Funding
  • GitHub Sponsors: https://github.com/emilkowalski
  • 4 GitHub sponsors

See all

Agent Skills for it
  • : Skills for Designers and Engineers.

See all

Head to head
Packages around it
  • lucide-react: Icon set
  • clsx: Conditional class names
  • tailwind-merge: Tailwind class merging
  • class-variance-authority: Variant class names
  • @radix-ui: Headless UI primitives
  • next-themes: Theme switching
More in UI components and icons

Alternatives

Sonner This page

MITGid 8261.9M/wk

React Hot Toast

Lightweight, customizable toast notification component library for React.

MITGid 705.4M/wk

Compare Sonner with another tool

Get started

Install it.

npm install sonner

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Sonner
- Install with `npm install sonner`. The getting-started docs show `pnpm i sonner`.
- Add `<Toaster />` to the app. The site says to render it in the root of your app. In Next.js it can go in `layout.tsx`, even when that file is a server component.
- Import `toast` from `'sonner'` and call `toast()` where the event happens. Do not add a context provider; peal.dev notes none is needed.
- Pass options as an object in the second argument to `toast()`. Use `toast.success`, `toast.error`, `toast.warning` and `toast.promise` for typed toasts.
- Do not call `toast()` inside a Server Action. Return a result from the action and fire the toast from a client component.
- Configure the toaster with props on `<Toaster />`: `position` for placement, `visibleToasts` for how many toasts show, `expand` and `richColors`.
- Do not use a toast as the only feedback for field validation. Supabase's docs say to use FormMessage or FieldError beside the field.