showToast
Display a temporary notification toast message to the user. Toasts automatically appear at the top center of the screen and dismiss after a configurable duration.Type Signature
Parameters
Configuration object for the toast notification.
Toast Styles
The toast system uses the following color scheme:| Type | Background Color | Text Color |
|---|---|---|
success | #10b981 (green) | #ffffff (white) |
error | #ef4444 (red) | #ffffff (white) |
warning | #f59e0b (orange) | #ffffff (white) |
info | #3b82f6 (blue) | #ffffff (white) |
Usage Examples
Success Toast
Error Toast
Warning Toast
Info Toast
Real-World Usage
Fromsrc/components/qr-code-app/cards/qr-preview/card-qr-preview.tsx:102-105:
Animation Behavior
Toasts animate in with a slide-down effect and fade out with a slide-up effect. The animation keyframes are: Slide Down (entrance):Implementation Details
- Toasts are positioned
fixedat the top center of the viewport - Multiple toasts stack vertically with
0.5remspacing - The toast container has
z-index: 9999to appear above all other content - Toasts are pointer-event transparent except for their own content
- The toast system auto-initializes a container on first use
Source Reference
Implemented insrc/domain/ui/toast.ts:65-132.