c-sonner-6.tsx
import { toast } from "sonner"
import { Button } from "@/components/ui/button"
export function Pattern() {
return (
<div className="flex items-center justify-center">
<Button
onClick={() =>
toast("Message archived", {
description: "The conversation has been moved to archive.",
action: {
label: "Undo",
onClick: () => toast.success("Action undone"),
},
})
}
variant="outline"
className="w-fit"
>
Toast with Action
</Button>
</div>
)
}
























