notify-bolt
v1.0.5
Published
A customizable React alert and modal system with theme support, multiple variants, and global configuration.
Maintainers
Readme
✨ Features
- ✅ Easy to integrate
- 🎨 Fully customizable (styles, icons, animations, etc.)
- 🌗 Light & Dark mode support
- ⚡ Zero dependencies
- 💡 Built-in variants:
classic,default - 🧩 Extendable global defaults with
setNotifyDefaults - 🎥 Smooth modal animations
- 🔄 Async handling with
Promise(confirm,deny,dismiss)
📦 Installation
npm install notify-bolt
# or
yarn add notify-bolt
# or
pnpm add notify-bolt🚀 Quick Usage
import { showNotify } from 'notify-bolt';
const handleClick = () => {
showNotify({
title: 'Delete this item?',
message: 'This action is permanent. Do you wish to proceed?',
variant: 'classic',
mode: 'dark',
status: 'warning',
showConfirmButton: true,
showCancelButton: true,
})
.then((result) => {
if (result === 'confirm') {
// ✅ User confirmed
} else if (result === 'deny') {
// ⚠️ User denied
}
})
.catch(() => {
// ❌ User dismissed
});
};🔧 Global Configuration
You can set defaults once and reuse them across all modals:
import { setNotifyDefaults } from 'notify-bolt';
setNotifyDefaults({
mode: 'light',
defaultSize: 'sm',
animation: 'slide-up',
confirmButtonText: 'Okay',
cancelButtonText: 'Cancel',
icons: {
success: '✅',
error: '❌',
info: 'ℹ️',
},
});📜 License
MIT © codx-ak
