Bundui.io

Sonner Custom Color Toast

Buttons 2

About

A button that triggers a Sonner promise toast with custom loading, success, and error states and a custom accent color.

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

Code

How Sonner Custom Color 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 ToastComponent from "@/components/ui/toast7";
import { Toaster, toast } from "sonner";

export default function Default() {
  useEffect(() => {
    const id = setTimeout(() => {
      toast.success("Password changed successfully", {
        style: {
          "--normal-bg": "#0284c7",
          "--normal-text": "#ffffff",
          "--normal-border": "#0284c7",
          "--success-bg": "#0284c7",
          "--success-text": "#ffffff",
          "--success-border": "#0284c7",
        } as React.CSSProperties,
        duration: 100000,
      });
    }, 400);
    return () => clearTimeout(id);
  }, []);

  return (
    <div className="relative flex min-h-[240px] w-full items-center justify-center bg-background text-foreground">
      <ToastComponent />
      <Toaster position="bottom-right" />
    </div>
  );
}

Dependencies

More by Bundui.io

View all
  • Fluid particles background

    Fluid particles background

    758
  • Floating paths

    Floating paths

    638
  • Text Gradient Scroll

    Text Gradient Scroll

    614
  • Stars

    Stars

    536
  • Image Comparison

    Image Comparison

    429
  • Magnetic Button

    Magnetic Button

    402
  • Marquee Effect

    Marquee Effect

    318
  • Wavy

    Wavy

    194

More in Buttons

View all
  • Button

    Button

    14
  • Button

    Button

    34
  • Texture Button

    Texture Button

    92
  • Button Save

    Button Save

    46
  • Button

    Button

    64
  • Button Group

    Button Group

    3
  • App Store Button

    App Store Button

    454
  • Notification Button

    Notification Button

    103