Toaster
Notifications
Short confirmations that come and go — saved, copied, sent. Nothing only in a toast should be needed later; errors people must act on belong in the page or an Alert.
Basic
Undo over confirm: if an action can be reversed, do it and offer the way back.
Undo
- plot.md
- route-a.md
- route-b.md
- Mount one BlessToaster; call
useToast()anywhere. Toasts are announced politely;dangerones interrupt. - Timers pause while the pointer or keyboard focus is in the toaster, so an action button doesn't vanish mid-reach;
duration: 0keeps one until dismissed. actionadds one button;positionpicks the corner;labelnames the region.
Usage
ts
import { BlessToaster } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
position | "top-right" | "top-left" | "bottom-right" | "bottom-left" | "top-center" | "bottom-center" | "bottom-right" | |
closeLabel | string | "Dismiss" | |
label | string | "Notifications" | the region's name |