You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flexible notification system with individual toast components and global container management for user feedback and alerts.
Overview
The ForgeToast system provides a comprehensive notification solution with individual toast components and a global container system. It supports multiple variants, auto-dismiss functionality, progress indicators, and queue management while maintaining accessibility and performance standards.
Key Features
Multiple Variants: Info, success, warning, and error types
Auto-Dismiss: Configurable timeout with progress indicators
Queue Management: Global container with positioning options
Interactive Elements: Dismissible with custom actions
Progress Visualization: Optional progress bars for timed toasts
Accessibility: Full ARIA support and keyboard navigation
Global Helpers: Utility functions for easy toast creation
AI-Ready: Complete AI metadata for state explanation
<!-- Add container to your app --><forge-toast-containerposition="top-right"></forge-toast-container><script>import{showToast}from'@nexcraft/forge/utils';// Show a simple toastshowToast({message: "Hello World!",variant: "info"});// Show toast with title and custom durationshowToast({title: "Success!",message: "Your changes have been saved.",variant: "success",duration: 3000});</script>
Advanced Usage
Custom Toast with Progress
<forge-toastvariant="warning"
title="Processing..."
message="Please wait while we process your request"
duration="10000"
persistent="false"
show-progress="true"
dismissible="true"
toast-id="process-toast"
@toast-dismissed="${handleToastDismissed}"
></forge-toast>
<script>consttoastId=showToast({title: "Uploading...",message: "Please wait while we upload your files",variant: "info",duration: 10000,showProgress: true,persistent: false});// Update progress or dismiss when donesetTimeout(()=>{document.querySelector(`forge-toast[toast-id="${toastId}"]`)?.dismiss();showToast.success("Upload completed!");},8000);</script>
AI Integration
State Explanation
consttoast=document.querySelector('forge-toast');console.log(toast.explainState());// "Toast is info variant, auto-dismissing in 3.2 seconds, user can dismiss manually"