Sweet Alert++ โ€“ A Modern, Accessible Modal Library (SweetAlert2 Alternative)
raiank.github.ioยท10hยท
Discuss: Hacker News
๐Ÿ”๏ธAlpine.js
Preview
Report Post

Alert Dialogs

Simple notification modals with a single action button.

Click a button to see the result...

// Simple Alert
Swal.modal({
title: 'Hello!',
text: 'This is a simple alert message.',
icon: 'info',
buttons: { confirm: 'OK' }
});

// Alert with Title
Swal.modal({
title: 'Welcome Back!',
text: 'We missed you. Check out the new features.',
icon: 'success',
buttons: { confirm: 'Explore' }
});

// Rich HTML Alert
Swal.modal({
title: 'Rich Content',
html: `
<div style="text-align: center;">
<img src="https://via.placeholder.com/100" style="border-radius: 50%;">
<p style="margin-top: 1rem;">You can use <strong>HTML</strong> content!</p>
</div>
`,
buttons: { confirm: 'Got it!' }
});

// Auto-Close Alert
Swal.modal({
title: 'Auto-Close',
text: 'This will close in 3 seconds....

Similar Posts

Loading similar posts...