đ GA Toasts - Best JavaScript Toast Notifications Library 2024
The ultimate JavaScript toast notifications library! Beautiful, modern, and accessible toast notifications that elevate your web applications with smooth animations and intuitive design. Featuring 15+ types, 9 positions, 4 animations, and 3 themes. Perfect for React, Vue, Angular, and vanilla JavaScript projects.
Appearance
Switch between light, dark, or system theme. Your choice is remembered for future visits.
Why Choose GA Toasts for Your Next Project?
GA Toasts is the most comprehensive and modern JavaScript toast notifications library available in 2024. Whether you're building a React application, Vue.js project, Angular app, or using vanilla JavaScript, GA Toasts provides everything you need for beautiful, accessible, and performant toast notifications.
đ¯ Key Benefits:
- Framework Agnostic: Works seamlessly with React, Vue, Angular, and vanilla JavaScript
- Lightweight & Fast: Minimal bundle size with optimized performance
- Accessibility First: Built with ARIA attributes and keyboard navigation support
- Mobile Responsive: Perfect display on all device sizes and orientations
- Highly Customizable: Extensive theming options and CSS variable support
- Modern Design: Glassmorphism effects, smooth animations, and contemporary styling
Perfect for: Web applications, dashboards, admin panels, e-commerce sites, SaaS platforms, mobile web apps, and any project requiring user feedback notifications.
Basic Toast Types
// Basic toast types (title is required)
GaToasts.success('Operation completed successfully!', { title: 'Success' });
GaToasts.error('Something went wrong!', { title: 'Error' });
GaToasts.warning('Please check your input', { title: 'Warning' });
GaToasts.info('Here is some information', { title: 'Info' });
GaToasts.show({
type: 'primary',
title: 'Primary Notification',
message: 'Primary notification'
});
GaToasts.show({
type: 'secondary',
title: 'Secondary Notification',
message: 'Secondary notification'
});
Advanced Features
// Advanced features (title is required)
GaToasts.show({
title: 'New Message',
message: 'You have received a new message from John Doe',
type: 'info',
duration: 5000
});
GaToasts.show({
title: 'File Upload',
message: 'File uploaded successfully',
type: 'success',
actions: [
{ text: 'View', click: () => console.log('View clicked') },
{ text: 'Dismiss', click: (e, toast) => GaToasts.close(toast) }
]
});
GaToasts.confirm('Are you sure you want to delete this item?', {
title: 'Confirm Deletion',
onConfirm: () => console.log('Confirmed'),
onCancel: () => console.log('Cancelled')
});
// Enable swipe-to-close interaction on touch devices
GaToasts.show({
title: 'Swipe to close',
message: 'Drag this toast left or right on touch devices to dismiss it.',
type: 'info',
swipeToClose: true
});
Density & Status
// Compact toast with status chip and inline link
GaToasts.show({
title: 'New Message',
message: 'You have received a new message from John Doe. <a href="#">Open inbox</a>',
type: 'info',
duration: 5000,
compact: true,
showStatus: true
});
// Success toast with explicit status text
GaToasts.show({
title: 'Deployed',
message: 'Your changes are live.',
type: 'success',
compact: true,
showStatus: true,
statusText: 'Production'
});
Toast Variants & Sizes
// Variants and sizes (title is required)
GaToasts.show({
title: 'Filled Variant',
message: 'Filled variant toast',
type: 'success',
variant: 'filled'
});
GaToasts.show({
title: 'Light Variant',
message: 'Light variant toast',
type: 'info',
variant: 'light'
});
GaToasts.show({
title: 'Small Toast',
message: 'Small toast',
type: 'warning',
size: 'sm'
});
GaToasts.show({
title: 'Large Toast',
message: 'Large toast with more content',
type: 'primary',
size: 'lg'
});
Animation Effects
// Animation effects (title is required)
GaToasts.show({
title: 'Fade Animation',
message: 'Fade animation',
type: 'info',
animation: 'fade'
});
GaToasts.show({
title: 'Slide Animation',
message: 'Slide animation',
type: 'success',
animation: 'slide'
});
GaToasts.show({
title: 'Bounce Animation',
message: 'Bounce animation',
type: 'warning',
animation: 'bounce'
});
// Add custom effects after creation
const toast = GaToasts.show({
title: 'Custom Effect',
message: 'Custom effect',
type: 'info'
});
toast.addClass('ga-toast-shake');
Position Control
// Position control (title is required)
GaToasts.show({
title: 'Positioned Toast',
message: 'Toast at specific position',
type: 'info',
position: 'top-center'
});
// Available positions:
// top-start, top-center, top-end
// middle-start, middle-center, middle-end
// bottom-start, bottom-center, bottom-end
Theme Control
// Theme control
document.documentElement.setAttribute('data-ga-theme', 'dark');
// Available themes:
// 'light' - Light theme
// 'dark' - Dark theme
// 'system' - Follows system preference
Progress & Timing
// Progress and timing options (title is required)
GaToasts.show({
title: 'Progress Toast',
message: 'Toast with progress bar',
type: 'info',
progress: true,
duration: 5000,
progressPosition: 'bottom'
});
GaToasts.show({
title: 'Top Progress',
message: 'Progress bar at the top edge',
type: 'primary',
progress: true,
duration: 4000,
progressPosition: 'top'
});
GaToasts.show({
title: 'No Auto Close',
message: 'No auto close',
type: 'warning',
duration: 0,
closable: true,
progressPosition: 'none'
});
GaToasts.show({
title: 'Click to Close',
message: 'Click to close',
type: 'info',
clickToClose: true
});
Toast Management
// Toast management (title is required)
// Show multiple toasts
for (let i = 1; i <= 3; i++) {
GaToasts.info(`Toast ${i}`, { title: `Info ${i}` });
}
// Update existing toast
const toast = GaToasts.show({
id: 'updateable-toast',
title: 'Initial Toast',
message: 'Initial message',
type: 'info'
});
setTimeout(() => {
GaToasts.update('updateable-toast', {
title: 'Updated Toast',
message: 'Updated message!',
type: 'success'
});
}, 2000);
// Management methods
GaToasts.closeAll();
GaToasts.clear('error'); // Clear only error toasts
const count = GaToasts.getCount();
Key Features
đ¨ Modern Design
Beautiful, modern toast notifications with glassmorphism effects, gradients, and smooth animations.
âŋ Accessible
Built with accessibility in mind, supporting screen readers and keyboard navigation.
đą Responsive
Fully responsive design that works perfectly on all device sizes and orientations.
đ Multiple Variants
Support for filled, light, and default variants with custom styling options.
⥠Performance
Lightweight and optimized for performance with minimal impact on page load times.
đ§ Customizable
Highly customizable with CSS variables, themes, and extensive configuration options.
đ Complete Toast Notifications Guide 2024
Everything you need to know about implementing modern toast notifications in your web applications. This comprehensive guide covers best practices, accessibility standards, and performance optimization.
Table of Contents:
đĨ Free Resources
đ Toast Implementation Checklist
Complete checklist for implementing accessible toast notifications
Download PDFđ Toast Library Comparison 2024
See how GA Toasts compares to other popular toast notification libraries in the market.
| Feature | GA Toasts | React Toastify | Vue Toastification | Angular Toastr |
|---|---|---|---|---|
| Bundle Size | 2.1KB | 4.2KB | 3.8KB | 5.1KB |
| Toast Types | 15+ | 6 | 8 | 4 |
| Positions | 9 | 6 | 6 | 4 |
| Animations | 4 | 2 | 3 | 1 |
| Accessibility | Full ARIA | Basic | Basic | Limited |
| Framework Support | All | React Only | Vue Only | Angular Only |