Components

Sonner

Toast notifications.

Installation

npx shadcn@latest add @blank/sonner

Usage

import { toast } from "sonner"

import { Toaster } from "@/components/ui/sonner"
// once, near the root of the app
;<Toaster />

// anywhere
toast.success("Saved")

Toaster reads the theme from next-themes and draws its surface from the popover tokens. Without a ThemeProvider, pass theme yourself.

Examples

Types