Skip to content

Toaster

Terminal window
npx skeci-ui add toaster
  1. Add the Toaster component to your root layout.
import { Toaster } from '@/components/ui/toaster';
export default function RootLayout({ children }) {
return (
<html>
<body>
<main>{children}</main>
<Toaster />
</body>
</html>
);
}
  1. Trigger a toast from anywhere in your app.
import { toast } from '@/components/ui/toaster';
toast("Hello World");

The Toaster component accepts all props from sonner.