animated-toast-minimal-demo
jolyui-ui/animated-toast-minimal-demoFreeExample
jolyui/ui publishes no description for this item.
Install it
npx shadcn@latest add https://jolyui.dev/r/animated-toast-minimal-demo.jsonSource
1"use client";23import { useState } from "react";4import { MinimalToast } from "@/registry/default/ui/animated-toast";56export default function AnimatedToastMinimalDemo() {7 const [showToast, setShowToast] = useState(false);89 const triggerToast = (10 _type: "success" | "error" | "warning" | "info" | "default",11 ) => {12 setShowToast(true);13 setTimeout(() => setShowToast(false), 3000);14 };1516 return (17 <div className="p-8">18 <div className="flex flex-wrap gap-4">19 <button20 onClick={() => triggerToast("success")}21 className="rounded-md bg-green-500 px-4 py-2 text-white transition-colors hover:bg-green-600"22 >23 Success24 </button>25 <button26 onClick={() => triggerToast("error")}27 className="rounded-md bg-red-500 px-4 py-2 text-white transition-colors hover:bg-red-600"28 >29 Error30 </button>31 <button32 onClick={() => triggerToast("warning")}33 className="rounded-md bg-yellow-500 px-4 py-2 text-white transition-colors hover:bg-yellow-600"34 >35 Warning36 </button>37 <button38 onClick={() => triggerToast("info")}39 className="rounded-md bg-blue-500 px-4 py-2 text-white transition-colors hover:bg-blue-600"40 >41 Info42 </button>43 <button44 onClick={() => triggerToast("default")}45 className="rounded-md bg-gray-500 px-4 py-2 text-white transition-colors hover:bg-gray-600"46 >47 Default48 </button>49 </div>5051 <MinimalToast52 open={showToast}53 onClose={() => setShowToast(false)}54 message="This is a minimal toast notification!"55 type="success"56 />57 </div>58 );59}
What it pulls in
npm packages
Other registry items
Files it writes
More from jolyui/ui
All 199 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-prompt-box-demoai-prompt-box-demo | jolyui/ui | Examples | Free | no deps | |
| ai-prompt-box-loading-demoai-prompt-box-loading-demo | jolyui/ui | Examples | Free | no deps | |
| animated-beam-bidirectional-demoanimated-beam-bidirectional-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-curved-demoanimated-beam-curved-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-demoanimated-beam-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-multiple-demoanimated-beam-multiple-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-table-basic-demoanimated-table-basic-demo | jolyui/ui | Examples | Free | no deps | |
| animated-table-column-demoanimated-table-column-demo | jolyui/ui | Examples | Free | no deps |
