Quick start guide and documentation
<head>)
</body>)
generateAlert({
type: 'success',
message: 'Welcome!',
details: 'Your account has been created successfully.',
location: '#alertContainer'
});
generateAlert({
type: 'success',
message: 'Form Submitted!',
details: 'Thank you for your submission.',
location: '#formAlerts',
timeout: 5000 // Auto-close after 5 seconds
});
generateAlert({
type: 'danger',
message: 'Validation Error',
details: 'Please check the highlighted fields.',
location: '#formAlerts'
});
generateAlert({
type: 'info',
message: 'New Feature Available',
details: 'Check out our new dashboard layout!',
location: '#alertContainer',
dropShadow: 'alert-dropshadow-c'
});
generateAlert({
type: 'warning',
message: 'Session Expiring',
details: 'Your session will expire in 5 minutes.',
location: '#alertContainer',
timeout: 10000 // Show for 10 seconds
});
generateAlert({
type: 'info',
message: 'Custom Brand Alert',
details: 'This matches our brand colors!',
location: '#alertContainer',
overrideBackgroundColor: '#9b59b6',
overrideIcon: 'fa-star',
dropShadow: 'alert-dropshadow-c'
});
| Type | Color | Best For | Icon |
|---|---|---|---|
success |
Green | Confirmations, completed tasks | ✓ Check circle |
danger |
Red | Errors, critical warnings | ⚠ Triangle |
warning |
Yellow | Cautions, pending issues | ⚠ Triangle |
info |
Cyan | Tips, announcements | ℹ Info circle |
default |
Gray | Generic messages | ℹ Info circle |
| Class | Effect | Best For |
|---|---|---|
alert-dropshadow-a |
Deep inset | Important alerts |
alert-dropshadow-b |
Multi-layer | Dramatic effect |
alert-dropshadow-c |
Subtle inset | Most common use ⭐ |
alert-dropshadow-d |
External shadow | Lifted appearance |
For alerts that are pre-rendered in HTML:
generateAlert({
type: 'info',
message: 'Processing...',
details: 'Please wait.',
location: '#alerts',
onShow: function() {
// Start your process
startProcess();
},
onClose: function() {
// Clean up or redirect
console.log('User dismissed alert');
}
});
generateAlert({
// REQUIRED
type: 'success', // 'success', 'danger', 'warning', 'info', 'default'
message: 'Title', // Main heading
details: 'Message text', // Detailed message
location: '#container', // CSS selector (#id or .class)
// OPTIONAL - Styling
dropShadow: 'alert-dropshadow-c', // Shadow class
wrapMessage: 'true', // Wrap details in styled box
animation: 'fade-in', // CSS animation class
overrideIcon: 'fa-star', // Custom FontAwesome icon
// OPTIONAL - Colors
overrideBackgroundColor: '#9b59b6', // Custom background
overrideTextColor: '#ffffff', // Custom text
overrideTitleColor: '#ffffff', // Custom title
overrideIconColor: '#f1c40f', // Custom icon
overrideCloseColor: '#ffffff', // Custom close button
// OPTIONAL - Behavior
timeout: 3000, // Auto-close after milliseconds
onShow: function() { }, // Callback when shown
onClose: function() { } // Callback when closed
});
.closeinlay-alerts.js is loaded.inlay-alert# or .color-helper.js is loaded firstalert-dropshadow-c for most alerts—it's subtle and professional
timeout for success messages—users don't need to manually close them
timeout for error messages—users need time to read and act
onClose callback to trigger the next action in a workflow
You don't need to do anything special—alerts are ADA-compliant by default:
role="alert"aria-labelOpen inlay-alerts.html in your browser
Use playground.html as a template
Check INLAY-ALERTS-DOCUMENTATION.md for complete API