Bundui.io

Sonner Toast

Buttons 13

About

A button that triggers a Sonner toast notification with a description and an undo action.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Sonner Toast to your project and fits it to your theme.

Code

How Sonner Toast is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { useEffect } from "react";
import Toast1 from "@/components/ui/toast1";
import { toast, Toaster } from "sonner";

export default function Default() {
  useEffect(() => {
    const id = setTimeout(() => {
      toast("Event has been created", {
        description: "Sunday, December 03, 2023 at 9:00 AM",
        action: {
          label: "Undo",
          onClick: () => console.log("Undo"),
        },
      });
    }, 120);
    return () => clearTimeout(id);
  }, []);

  return (
    <div className="relative flex min-h-[340px] w-full items-center justify-center gap-6 bg-background p-8">
      <Toast1 />
      <Toaster position="bottom-center" />
    </div>
  );
}

Dependencies

More by Bundui.io

View all
  • Fluid particles background

    Fluid particles background

    833
  • Floating paths

    Floating paths

    706
  • Text Gradient Scroll

    Text Gradient Scroll

    648
  • Stars

    Stars

    564
  • Image Comparison

    Image Comparison

    429
  • Magnetic Button

    Magnetic Button

    412
  • Marquee Effect

    Marquee Effect

    340
  • Wavy

    Wavy

    219

More in Buttons

View all
  • Button

    Button

    16
  • Texture Button

    Texture Button

    110
  • Astryx Button Group

    Astryx Button Group

    27
  • Button

    Button

    135
  • Button

    Button

    36
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Eclipse Button

    Eclipse Button

    9
  • HeroUI Toggle Button

    HeroUI Toggle Button

    2