A succinct message that is displayed temporarily.
npx ever-ui-clx@0.2.1 add demo-toast npx ever-ui-clx@0.2.1 add toaster npx ever-ui-clx@0.2.1 add hooks/use-has-focus npx ever-ui-clx@0.2.1 add hooks/use-media-query
tailwind.config.ts
// tailwind.config.ts module.exports = { theme: { extend: { colors: { success: { DEFAULT: "hsl(var(--success))", foreground: "hsl(var(--success-foreground))", }, warning: { DEFAULT: "hsl(var(--warning))", foreground: "hsl(var(--warning-foreground))", }, error: { DEFAULT: "hsl(var(--error))", foreground: "hsl(var(--error-foreground))", }, }, keyframes: { "trackToastDuration": { "0%": { transform: "scaleX(1)" }, "100%": { transform: "scaleX(0)" }, }, }, animation: { "trackToastDuration": "trackToastDuration ease-in-out forwards", }, }, }, };
globals.css
--success: 81 37% 44%; --success-foreground: 71 44% 95%; --warning: 32 95% 44%; --warning-foreground: 48 100% 96%; --error: 14 100% 53%; --error-foreground: 0 86% 97%;
Toaster
app/layout.tsx
import { Toaster } from "@/components/ui/toaster" export default function RootLayout({ children }) { return ( <html lang="en"> <body> <main>{children}</main> <Toaster /> </body> </html> ) }