ui icon indicating copy to clipboard operation
ui copied to clipboard

Add a promise toast

Open nonwiz opened this issue 2 years ago • 3 comments

I usually use react-hot-toast, there are quite some cool features, for example, you can call the toast, without using useToast. Another main reason is toast can embed the promise, useful for "Loading", "Success", or "Error" states.

nonwiz avatar Jun 20 '23 14:06 nonwiz

It would be really nice, I also has faced it

ph1losof avatar Jul 07 '23 09:07 ph1losof

Maybe not relevant but if you want toast within the same style I use library called sonner like this

"use client";

import { Toaster as RadToaster } from "sonner";

export function Toaster() {
  return (
    <RadToaster
      position="bottom-right"
      toastOptions={{
        style: {
          background: "hsl(var(--background))",
          color: "hsl(var(--foreground))",
          border: "1px solid hsl(var(--border))",
        },
      }}
    />
  );
}

ph1losof avatar Jul 11 '23 10:07 ph1losof

Sonner has been added to shadcn, this can be closed.

lacymorrow avatar Dec 29 '23 16:12 lacymorrow