Skip to main content
Gooey Toast provides five distinct toast types, each with its own color scheme and entrance animation to match the message context.

Overview

Each toast type is designed for a specific purpose:
  • Success - Confirm successful operations
  • Error - Alert users to failures or problems
  • Warning - Display cautionary messages
  • Info - Show general information
  • Loading - Indicate ongoing processes

Success toasts

Use success toasts to confirm that an operation completed successfully.
toast({ type: 'success', title: 'Saved!' });
Success toasts use a green color scheme and feature a smooth slide-up entrance animation.

With details

toast({
    type: 'success',
    title: 'Deployment complete',
    details: [
        { label: 'Environment', value: 'Production' },
        { label: 'Branch', value: 'main' },
    ],
    footer: 'https://deploy.example.com/logs/3f8a2c1',
});

Error toasts

Use error toasts to notify users of failures or critical issues.
toast({ type: 'error', title: 'Upload failed' });
Error toasts use a red color scheme and feature a slide-up animation combined with a shake effect to grab attention.

With error details

toast({
    type: 'error',
    title: 'Upload failed',
    details: [
        { label: 'File', value: 'report.pdf' },
        { label: 'Error', value: 'File too large' },
    ],
    footer: 'Max file size: 10 MB',
});

Warning toasts

Use warning toasts to display cautionary messages or important notices.
toast({ type: 'warning', title: 'Warning message' });
Warning toasts use an amber color scheme and feature a slide-up animation with a bounce effect.

Delete confirmation example

toast({
    type: 'warning',
    title: 'Delete account',
    actions: [
        { label: 'Delete', icon: 'trash', event: 'delete-account', color: '#ef4444', confirm: true },
    ],
});

Info toasts

Use info toasts to display general information or neutral messages.
toast({ type: 'info', title: 'Information' });
Info toasts use a blue color scheme and feature a smooth slide-up entrance animation.

With avatar and message

toast({
    type: 'info',
    title: 'Melissa',
    avatar: '/avatars/melissa.jpg',
    message: 'Please visit HR when you get a chance 👋',
    footer: '1h ago',
});

Loading toasts

Use loading toasts to indicate that a process is in progress.
toast({ type: 'loading', title: 'Processing...' });
Loading toasts use a gray color scheme with a spinner icon and feature a smooth slide-up entrance animation.

Promise toasts

Loading toasts are often used with promises that automatically resolve to success or error:
toast.promise(fetch('/api/save'), {
    loading: 'Saving...',
    success: 'Saved!',
    error: 'Failed to save',
});

Type comparison

TypeColorEntrance animationUse case
successGreenSmooth slide-upConfirm successful operations
errorRedSlide-up + shakeAlert users to failures
warningAmberSlide-up + bounceDisplay cautionary messages
infoBlueSmooth slide-upShow general information
loadingGraySmooth slide-upIndicate ongoing processes

Custom colors

You can override the default type color for any toast:
toast({ type: 'success', title: 'VIP Access Granted', color: '#8b5cf6' });
The custom color applies to:
  • Icon color
  • Title color
  • Timer bars
  • Progress bars
Custom colors work with all toast types, including progress toasts and undo toasts.

Examples with custom colors

// Custom success toast
toast({ type: 'success', title: 'Branded notification', color: '#8b5cf6' });

// Custom progress toast
toast.progress('Syncing...', { color: '#ec4899' });

// Custom persistent toast
toast({ type: 'info', title: 'Custom', color: '#06b6d4', persistent: true });

Build docs developers (and LLMs) love