{
 "kind": "tool",
 "slug": "sonner",
 "path": "tools/sonner/",
 "name": "Sonner",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "UI components and icons",
   "tools/ui-components/"
  ]
 ],
 "lead": "Opinionated toast notification component for React applications.",
 "chips": [
  {
   "label": "UI components and icons",
   "path": "tools/ui-components/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install sonner"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/emilkowalski/sonner"
  },
  {
   "label": "Website",
   "href": "https://sonner.emilkowal.ski/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/emilkowalski/sonner"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Aug 10, 2026",
   "note": "Latest GitHub release Aug 9, 2026. ",
   "src": "https://github.com/emilkowalski/sonner"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "584 projects",
   "status": "info",
   "sub": "#4 of 230 in its category",
   "note": "Dependency in 584 public GitHub projects set up for AI coding agents that we scanned (9.3%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Official agent skills",
   "status": "yes",
   "sub": "1 from the makers",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Sonner does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Sonner popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "82",
       "of": "/ 100",
       "l": "Gid Score, #71 overall"
      },
      {
       "n": "61.9M",
       "l": "downloads a week, npm"
      },
      {
       "n": "13.3K",
       "l": "GitHub stars"
      },
      {
       "n": "584",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Sonner is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "303 projects, 12.4%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "293 projects, 8.9%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "260 projects, 8.6%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "36 projects, 7.7%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "34 projects, 7.2%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "33 projects, 11.8%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "28 projects, 8.2%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "19 projects, 13.6%",
       "v": "Kiro",
       "path": "agents/kiro/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 96.4% of its projects",
       "v": "Lucide React",
       "path": "tools/lucide-react/"
      },
      {
       "l": "In 95.7% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 95.4% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      },
      {
       "l": "In 94.2% of its projects",
       "v": "Class Variance Authority",
       "path": "tools/class-variance-authority/"
      },
      {
       "l": "In 79.3% of its projects",
       "v": "Radix UI",
       "path": "tools/radix-ui/"
      },
      {
       "l": "In 99.8% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 99.7% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 75.5% of its projects",
       "v": "next-themes",
       "path": "tools/next-themes/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Sonner in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "No provider to wrap the app in",
       "v": "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."
      },
      {
       "l": "Toaster can sit in a server component",
       "v": "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."
      },
      {
       "l": "One toast for a whole promise",
       "v": "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."
      },
      {
       "l": "Swipe follows position",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Server Actions cannot fire toasts",
       "v": "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."
      },
      {
       "l": "Heavy custom designs fit less well",
       "v": "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."
      },
      {
       "l": "Rapid clicks still need debouncing",
       "v": "peal.dev says Sonner \"handles this somewhat\" when someone clicks submit several times. In their view, you still need to debounce the action itself."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mount the Toaster and fire a toast"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Jsx",
       "code": "import { Toaster, toast } from 'sonner';\n\n// ...\n\nfunction App() {\n  return (\n    <div>\n      <Toaster />\n      <button onClick={() => toast('My first toast')}>Give me a toast</button>\n    </div>\n  );\n}"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Sonner",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/emilkowalski",
        "4 GitHub sponsors"
       ]
      },
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        ": Skills for Designers and Engineers."
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "Sonner vs React Hot Toast",
         "note": "used together in 27 projects",
         "path": "tools/compare/sonner-vs-react-hot-toast/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "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"
       ]
      },
      {
       "title": "More in UI components and icons",
       "path": "tools/ui-components/",
       "items": [
        {
         "text": "Lucide React",
         "path": "tools/lucide-react/"
        },
        {
         "text": "Class Variance Authority",
         "path": "tools/class-variance-authority/"
        },
        {
         "text": "Radix UI",
         "path": "tools/radix-ui/"
        },
        {
         "text": "cmdk",
         "path": "tools/cmdk/"
        },
        {
         "text": "React Day Picker",
         "path": "tools/react-day-picker/"
        },
        {
         "text": "Vaul",
         "path": "tools/vaul/"
        },
        {
         "text": "react-resizable-panels",
         "path": "tools/react-resizable-panels/"
        },
        {
         "text": "shadcn/ui",
         "path": "tools/shadcn/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Sonner",
       "me": true,
       "facts": [
        "MIT",
        "Gid 82",
        "61.9M/wk"
       ]
      },
      {
       "name": "React Hot Toast",
       "why": "Lightweight, customizable toast notification component library for React.",
       "path": "tools/react-hot-toast/",
       "facts": [
        "MIT",
        "Gid 70",
        "5.4M/wk"
       ]
      }
     ],
     "more": "Compare Sonner with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install sonner"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Sonner\n- Install with `npm install sonner`. The getting-started docs show `pnpm i sonner`.\n- 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.\n- Import `toast` from `'sonner'` and call `toast()` where the event happens. Do not add a context provider; peal.dev notes none is needed.\n- Pass options as an object in the second argument to `toast()`. Use `toast.success`, `toast.error`, `toast.warning` and `toast.promise` for typed toasts.\n- Do not call `toast()` inside a Server Action. Return a result from the action and fire the toast from a client component.\n- Configure the toaster with props on `<Toaster />`: `position` for placement, `visibleToasts` for how many toasts show, `expand` and `richColors`.\n- Do not use a toast as the only feedback for field validation. Supabase's docs say to use FormMessage or FieldError beside the field.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm sonner"
  ],
  [
   "Category",
   "UI components and icons"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v2.0.8, August 9, 2026"
  ],
  [
   "On GitHub since",
   "February 2023"
  ],
  [
   "Gid Score",
   "81.8"
  ],
  [
   "Rank in category",
   "#4 of 230"
  ],
  [
   "GitHub",
   "emilkowalski/sonner"
  ],
  [
   "Last change",
   "Aug 10, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/emilkowalski.png"
}