❤️ Support our project - Your donation helps us continue developing awesome tools!


Docs
Sonner

Sonner

An opinionated toast component for React.

Installation

Run the following command:

npx nyxb@latest add sonner

Add the Toaster component

app/layout.tsx
import { Toaster } from "~/components/ui/sonner"
 
export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <head />
      <body>
        <main>{children}</main>
        <Toaster />
      </body>
    </html>
  )
}

Usage

import { toast } from "sonner"
toast("Event has been created.")