Home Components Sonner
React Toast Components
20 free React toasts (Sonner) built with Tailwind CSS and shadcn/ui conventions. Copy the code or install with the shadcn CLI. Great for notifications, promise toasts, and actions.
Sonner 1 : Success toast for a deployment with a description and a green left border accent.Sonner 2 : Plain event reminder toast with a meeting time description and a sky blue left border.Sonner 3 : Custom delivery toast with a truck icon in an orange tile beside a title and subtitle.Sonner 4 : Profile update toast with a user avatar on the left of the title and message.Sonner 5 : Dismissible toast with a close button that can also auto-close on its own.Sonner 6 : Archive notification toast with an Undo action button to reverse the change.Sonner 7 : Promise toast that shows a loading message, then a success or error result after syncing.Sonner 8 : Grid of six buttons that open a toast in each screen position, from top left to bottom right.Sonner 9 : Soft info toast with a pale sky blue tint, blue text and a blue border.Sonner 10 : Soft success toast with a pale green tint for a completed file upload.Sonner 11 : Soft warning toast with a pale amber tint for a low storage alert.Sonner 12 : Soft destructive toast with a pale red tint for a permanent deletion warning.Sonner 13 : Outline info toast on the normal background with a sky blue border and text.Sonner 14 : Outline success toast on the normal background with a green border for a received payment.Sonner 15 : Outline warning toast with an amber border and text for an unrecognised login attempt.Sonner 16 : Outline error toast with a red border and text for revoked account access.Sonner 17 : Solid info toast with a filled sky blue background and white text.Sonner 18 : Solid success toast with a filled green background and white text for a finished backup.Sonner 19 : Solid warning toast with a filled amber background and white text for unusual activity.Sonner 20 : Solid error toast with a filled red background and white text for a critical failure.
About React Toast Components Sonner is a toast library for React that shows short notifications which stack and close on their own. Watermelon UI toasts use sonner with a themed Toaster styled with Tailwind CSS, covering success, error, action, and promise toasts. Add it with the shadcn CLI, render one Toaster in your root layout, then call toast() from anywhere in your app.
When to use it Confirming that a save, copy, or upload worked. Showing loading, success, and error states for an async request. Offering an undo action after a delete. When to use something else Use Alerts when the message should stay on the page until the issue is fixed. Use Dialog when the user must respond before continuing. Frequently asked questions Why is my sonner toast not showing? Usually the Toaster is not rendered. Add <Toaster /> once in your root layout inside body, and call toast() from a client component.
How do I show a loading toast that updates when a promise finishes? Use toast.promise(promise, { loading, success, error }). The same toast moves from the loading message to success or error when the promise settles.
How do I change the colors of a sonner toast? Pass richColors to Toaster for colored success, error, warning, and info toasts, or style them with toastOptions.classNames. The default toast reads your popover, popover-foreground, and border theme tokens, so changing those restyles it too.
How do I add an undo button to a toast? Pass an action object with a label and onClick, for example toast("Deleted", { action: { label: "Undo", onClick: restore } }). The button appears inside the toast.
How to use React Toast Components Start from a React project with Tailwind CSS and shadcn/ui set up. Next.js, Vite, Remix, and Astro all work. Run npx shadcn@latest add https://registry.watermelon.sh/r/sonner-1.json to add the source files to your project. Import it where you need it, then edit the Tailwind classes and design tokens to match your product. Dependencies installed with it: sonner, lucide-react.
The code is yours: it lives in your repository, so there is no runtime package to keep updated. Watermelon UI is free and open source under the MIT license.
More: Free React components , UI library alternatives , guides .