Feedback
Toast
A brief message that confirms something happened, with an optional action like Undo.
Ant Design: message, notification
import { ToastProvider, useToast } from '@alea/ui';
Examples
Toasts
show() from anywhere under ToastProvider. Hover or focus pauses the timer.
With an action
Undo is the classic.
Props
ToastProvider props
Shows toasts anywhere below it; put it once near the root.
| Prop | Type | Default | Description |
|---|---|---|---|
placement | "bottom-end" | "bottom" | "top-end" | "top" | 'bottom-end' | Where toasts stack: bottom-end (default), bottom, top-end or top. |
Accessibility
- Announced politely (errors assertively); timers pause on hover and focus.
- Errors stay until closed.
Keyboard
| Key | Does |
|---|---|
| F6 or Tab | Reaches the notifications region |
| Enter | Runs the action |
| Escape | Closes the focused toast |
Do and don't
Do
- Confirm actions people can't see the result of.
Don't
- Don't put the only way to do something in a toast.