
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
lucid-alerts
Advanced tools
A modern, lightweight, and highly customizable JavaScript library for alerts and notifications - an alternative to SweetAlert2 and Notyf
A modern, lightweight, and highly customizable JavaScript library for alerts and notifications. A beautiful alternative to SweetAlert2 and Notyf with built-in dark/light mode support and responsive design.
🎉 Latest Release: v1.1.3 - Updated documentation and stable release with latest features!
npm install lucid-alerts
yarn add lucid-alerts
<script src="https://cdn.jsdelivr.net/npm/lucid-alerts@1.1.3/dist/lucid-alerts.min.js"></script>
<script src="https://unpkg.com/lucid-alerts@1.1.3/dist/lucid-alerts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lucid-alerts@latest/dist/lucid-alerts.min.js"></script>
import LucidAlerts from 'lucid-alerts';
// Simple alert
LucidAlerts.alert('Hello World!');
// Success notification
LucidAlerts.success('Operation completed successfully!');
const LucidAlerts = require('lucid-alerts');
LucidAlerts.error('Something went wrong!');
<script src="https://cdn.jsdelivr.net/npm/lucid-alerts@1.1.3/dist/lucid-alerts.min.js"></script>
<script>
LucidAlerts.info('Welcome to LucidAlerts!');
</script>
// Simple alerts
LucidAlerts.success('Success message');
LucidAlerts.error('Error message');
LucidAlerts.warning('Warning message');
LucidAlerts.info('Info message');
// Alert with options
LucidAlerts.question({
title: 'Are you sure?',
text: 'This action cannot be undone.',
confirmText: 'Yes, delete it!',
cancelText: 'Cancel'
}).then(result => {
if (result) {
LucidAlerts.success('Deleted successfully!');
}
});
// Simple notification
LucidAlerts.notify({
type: 'success',
message: 'File uploaded successfully!',
position: 'top-right',
duration: 3000
});
// Persistent notification
LucidAlerts.notify({
type: 'warning',
title: 'Important Notice',
message: 'Please update your profile information.',
persistent: true,
position: 'top-center'
});
// Simple input
LucidAlerts.input({
title: 'Enter your name',
placeholder: 'Your name here...'
}).then(result => {
if (result.isConfirmed) {
console.log('Name:', result.value);
}
});
// Multi-input form
LucidAlerts.form({
title: 'User Registration',
inputs: [
{ name: 'username', type: 'text', placeholder: 'Username', required: true },
{ name: 'email', type: 'email', placeholder: 'Email', required: true },
{ name: 'age', type: 'number', placeholder: 'Age' }
]
}).then(result => {
if (result.isConfirmed) {
console.log('Form data:', result.values);
}
});
LucidAlerts automatically detects your system's theme preference and adapts accordingly. You can also manually control the theme:
// Set theme manually
LucidAlerts.setTheme('dark'); // 'light', 'dark', or 'auto'
// Get current theme
const currentTheme = LucidAlerts.getTheme();
| Method | Description | Returns |
|---|---|---|
alert(message, options?) | Shows a basic alert | Promise<boolean> |
success(message, options?) | Shows a success alert | Promise<boolean> |
error(message, options?) | Shows an error alert | Promise<boolean> |
warning(message, options?) | Shows a warning alert | Promise<boolean> |
info(message, options?) | Shows an info alert | Promise<boolean> |
question(message, options?) | Shows a question alert | Promise<boolean> |
input(options) | Shows an input dialog | Promise<{isConfirmed, value}> |
select(options) | Shows a select dialog | Promise<{isConfirmed, value}> |
form(options) | Shows a form dialog | Promise<{isConfirmed, values}> |
notify(options) | Shows a notification | string (notification ID) |
| Method | Description | Returns |
|---|---|---|
setTheme(theme) | Sets the theme ('light', 'dark', 'auto') | void |
getTheme() | Gets the current theme | string |
closeAll() | Closes all active alerts | void |
closeAllNotifications() | Closes all notifications | void |
getActiveAlerts() | Gets active alerts count | number |
getActiveNotifications() | Gets active notifications count | number |
{
title: 'Alert Title', // Alert title
text: 'Alert message', // Alert message
confirmText: 'OK', // Confirm button text
cancelText: 'Cancel', // Cancel button text
showCancel: false, // Show cancel button
timer: 0, // Auto-close timer (ms)
customClass: '', // Custom CSS class
allowOutsideClick: true, // Allow clicking outside to close
allowEscapeKey: true, // Allow ESC key to close
showCloseButton: true, // Show close button
onConfirm: null, // Confirm callback
onCancel: null, // Cancel callback
onClose: null // Close callback
}
{
type: 'info', // 'success', 'error', 'warning', 'info'
title: 'Notification Title', // Notification title
message: 'Notification text', // Notification message
position: 'top-right', // Position on screen
duration: 4000, // Duration in ms (0 = persistent)
persistent: false, // Never auto-close
showProgress: false, // Show progress bar
onClick: null, // Click callback
onClose: null // Close callback
}
LucidAlerts supports all modern browsers:
We welcome contributions! Please see our Contributing Guide for details.
git clone https://github.com/mukeshjena/lucid-alerts.gitnpm installnpm run devnpm run build:allnpm run build - Build the librarynpm run dev - Start development with watch modenpm run build:all - Build and minifynpm run demo - Start demo serverThis project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Mukesh Jena
FAQs
A modern, lightweight, and highly customizable JavaScript library for alerts and notifications - an alternative to SweetAlert2 and Notyf
We found that lucid-alerts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.