Sonner
View on shadcn/uiAn opinionated toast component for React.
About
Sonner is built and maintained by emilkowalski.
Installation
pnpm dlx shadcn@latest add https://designsystem.wfp.org/r/sonner.jsonAdd the Toaster component
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.");