A flexible and customizable toast notification system
Click the buttons below to see different toast notification types. Each type has its own color scheme and default icon.
These toasts will automatically disappear after a specified duration.
Add custom images or icons to your toast notifications.
Add action buttons to your toasts for user interaction.
Create toasts without the close button (must auto-dismiss or close programmatically).
Position toasts in different areas of the screen. Each position creates its own independent container.
// Import the toastAdd function
import { toastAdd } from '@liwe3/webcomponents';
// Show a toast notification
toastAdd({
title: 'Success!',
text: 'Your changes have been saved.',
type: 'success',
duration: 5000,
position: 'TR', // TL, T, TR, BL, B, BR (default: TR)
closable: true,
buttons: [
{
label: 'Undo',
onClick: () => console.log('Undo clicked')
},
{
label: 'View',
onClick: () => console.log('View clicked')
}
]
});