GodUIGodUI
109Follow on X

Toast

tsx
"use client";import { ToastProvider, toast } from "@/components/godui/toast";export function ToastDemo() {return (  <div className="flex flex-wrap items-center justify-center gap-3">    <button      type="button"      onClick={() =>        toast({ title: "Event created", description: "Friday at 5pm" })      }      className="rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground"    >      Create event    </button>    <button      type="button"      onClick={() =>        toast.success({ title: "Saved", description: "Your changes are live." })      }      className="rounded-lg bg-muted px-4 py-2 text-sm font-medium text-foreground"    >      Save changes    </button>    <button      type="button"      onClick={() =>        toast({          title: "Deleted file",          description: "report.pdf",          action: { label: "Undo", onClick: () => {} },        })      }      className="rounded-lg bg-muted px-4 py-2 text-sm font-medium text-foreground"    >      Delete file    </button>    <ToastProvider />  </div>);}