Advance Toast

This is an Advance Toast component.

Installation

1. Dependencies

npm install clsx tailwind-merge framer-motion

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Advance Toast Code

Loading...

Copy Advance Toast Code

Advance Toast Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the toast.
isOpenbooleanYesundefinedWhether the toast is open or not.
onClose() => voidYesundefinedFunction to call when the toast is closed.
durationnumberNo3000Duration in milliseconds before the toast closes automatically.
classNamestringNo""Additional class names for styling.