Toast
moleculeImperative toast notifications via ToastProvider + useToast hook. Five semantic variants with built-in icons, action buttons, cascading card stack with hover-to-expand, six screen positions, enter/exit animations, and configurable auto-dismiss.
Basic toast
Simple notification with title and description.
Variants
Default, success, warning, danger, and info variants with semantic icons.
With action
Toast with an inline undo action button.
Usage
Installation
API Reference
Toast props — * required
| Prop | Type | Default | Description |
|---|---|---|---|
position | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "bottom-right" | Screen position for the toast stack. |
duration | number | 5000 | Default auto-dismiss duration in ms. Pass Infinity to disable. |
portalContainer | HTMLElement | — | Custom portal target. Defaults to document.body. |
toast() | (options: ToastOptions) => string | — | Show a toast. Returns a dismissible id. Options: title, description, variant, action ({ label, onClick }), duration. |
dismiss() | (id: string) => void | — | Programmatically dismiss a toast by id. |