success, error, info, loading, and custom.
Success toasts
Success toasts display a green checkmark icon and are perfect for confirming positive actions like saves, updates, or completed operations.- Accent:
#28B770(green) - Background:
#FFFFFF(white)
Error toasts
Error toasts display a red X icon and are ideal for showing failures, validation errors, or issues that require user attention.- Accent:
#F05964(red) - Background:
#FFFFFF(white)
Error toasts trigger a shake animation when deduplicated, while other toast types use a subtle pulse effect.
Info toasts
Info toasts display a yellow/gold info icon and are great for general notifications, tips, or informational messages.- Accent:
#EDBE43(yellow/gold) - Background:
#FFFFFF(white)
Loading toasts
Loading toasts are special toasts designed for async operations. They don’t auto-dismiss and don’t show a close button by default.Using with promises
The most common way to use loading toasts is withtoast.promise(), which automatically transitions from loading to success or error:
- Shows a loading toast immediately
- Waits for the promise to resolve or reject
- Updates the same toast to success or error
- Returns
{ data, success: true }or{ error, success: false }
Promise message options
Each state (loading, success, error) accepts either a string or a message object:- Accent:
#232323(dark gray) - Background:
#FFFFFF(white)
Custom toasts
Custom toasts give you complete control over the toast content. Your component fills the entire toast container and receives all entry/exit/stack animations automatically.Basic custom toast
With render function
Use a render function to access toast properties and dismiss functionality:id- Unique toast identifierdismiss- Function to dismiss this toasttype- The toast type (defaults to “info” for custom toasts)isExiting- Whether the toast is currently animating out
Custom toast with options
type- Toast type for theming (defaults to “info”)duration- How long to show the toastdismissible- Whether swipe to dismiss is enabledshowCloseButton- Whether to show close button (custom toasts don’t render it automatically)style- Container style overridesid- Custom ID for deduplicationdeduplication- Enable/disable deduplication
When using
customContent, the default toast layout (icon, title, description, close button) is completely replaced. You have full control over rendering.Type definitions
From package/src/types.ts:5:API methods
| Method | Description | Source |
|---|---|---|
toast.success(title, descriptionOrOptions?, duration?) | Show success toast | package/src/toast-api.ts:198 |
toast.error(title, descriptionOrOptions?, duration?) | Show error toast | package/src/toast-api.ts:203 |
toast.info(title, descriptionOrOptions?, duration?) | Show info toast | package/src/toast-api.ts:208 |
toast.promise(promise, messages) | Show loading → success/error toast | package/src/toast-api.ts:213 |
toast.custom(content, options?) | Show fully custom toast | package/src/toast-api.ts:190 |