Toast
Brief notifications from anywhere with toast(): compact cards that slide in from a corner of the screen, pause on hover and can be swiped away.
import { Toaster, toast } from "pleate/toast";Tones, action, promise
Props
- toast(title, options)
Also toast.success / error / warning / info / loading / promise / update / dismiss.
→ id- options
Per toast.
description, action, duration, icon, dismissible, id- Toaster position
Where the stack sits. Mount one Toaster in the root layout.
"top-center" | "top-right" | "bottom-center" | "bottom-right"default "top-center"- Toaster visible
How many toasts show at once; the rest wait.
numberdefault 3- Toaster duration
Default time in ms before a toast closes.
numberdefault 4000- Toaster label
Accessible name of the region.
stringdefault "Notifications"- Toaster closeLabel
Accessible name of the dismiss button.
stringdefault "Dismiss"
Accessibility
- Polite live region; error toasts use role=alert.
- Timers pause while hovered or focused.