Toaster
Provides an easy-to-use notification system for displaying toast messages, built with a highly customizable and accessible foundation.
Usage
Quick example to demonstrate how the <Toaster />
works out of the box.
Properties
Use the interactive configurator below to explore available customization options — like position, duration, type, and animation.
Chaining Toasts
Display icon toast notifications and/or multiple toast notifications in sequence or in grouped logic.
Icon
Display icon in front of the message.
Installation
Install the required peer dependency:
Oeri UI's
Toaster
component is powered bysonner
, a minimal toast notification library with great accessibility and performance.
Configuration
Make sure to include the <Toaster />
component inside your application layout — typically after your ThemeProvider
.
import { ThemeProvider } from "@/config/themes";
import { Toaster } from "@/ui/toaster";
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="en" suppressHydrationWarning>
<body>
<ThemeProvider>
{children}
<Toaster />
</ThemeProvider>
</body>
</html>
);
}
API Reference
Toaster uses Sonner under the hood. For a full list of supported props and advanced usage:
Source Codes
Full working implementation you can copy and paste: