Develop a Next.js application that demonstrates the use of Sonner for toast notifications. The application should feature a prominent 'toaster' component with the 'expand' option enabled. The main page should be populated with a substantial amount of mock content, such as placeholder text, images, and interactive elements, to allow for vertical scrolling. This will enable users to test the toast notifications while scrolling through the page. The application should showcase different types of toast notifications (e.g., success, error, info) triggered by user interactions with the mock content. Ensure the design is responsive and visually appealing.
Let's create a Next.js application that demonstrates Sonner toast notifications with various examples and a scrollable page to test them.
This Sonner toast notification demo includes:
expand
option enabled in the root layoutVarious Toast Types:
Interactive Elements:
Responsive Design:
Theme Toggle:
The application uses the Sonner toast library integrated with Next.js and styled with Tailwind CSS. The main components are:
expand
option enabledAs you scroll through the page, you can interact with various elements to trigger different types of toast notifications, demonstrating how they work in a real-world application.