Components
Loading preview...
A succinct message that is displayed temporarily.
@shugar
npx shadcn@latest add https://21st.dev/r/shugar/toastimport { useState } from "react";
import { useToasts } from "@/components/ui/toast";
import { Button } from "@/components/ui/button-1";
export default function UndoDemo() {
const toasts = useToasts();
return (
<Button
onClick={(): void => {
toasts.message({
text: "The Evil Rabbit jumped over the fence. The Evil Rabbit jumped over the fence again.",
onUndoAction: () => 0
});
}}
>
Show Toast
</Button>
);
}