@devnexusx/notify-ui
v1.0.2
Published
Lightweight, customizable toast & modal notification system for vanilla JS and React
Maintainers
Readme
@devnexusx/notify-ui
A lightweight, customizable notification system — toasts + modals — for vanilla JavaScript and React. No dependencies. Tiny. Accessible.
npm install @devnexusx/notify-uiFeatures
- Toast notifications — success, error, warning, info
- Modal dialogs — confirm, alert, success
- Promise-based API (
confirm) - Multiple positions (top/bottom, left/right/center)
- Built-in animations (slide, fade, bounce)
- Queue system for multiple toasts
- Light / dark / auto theme
- Fully customizable content (HTML)
- Accessible (ARIA + keyboard support)
- ESM + CJS + TypeScript types
Usage
Vanilla JS
import { showSuccess, showError, confirm } from "@devnexusx/notify-ui";
showSuccess("Saved!");
showError("Something went wrong.");
const ok = await confirm({ message: "Continue?" });React
import { NotifyProvider, useNotify } from "@devnexusx/notify-ui/react";
function App() {
return (
<NotifyProvider>
<Demo />
</NotifyProvider>
);
}
function Demo() {
const { showSuccess, confirm } = useNotify();
return (
<button
onClick={async () => {
if (await confirm({ message: "Are you sure?" })) {
showSuccess("Done!");
}
}}
>
Click
</button>
);
}API
Toast
showSuccess(message, options?)
showError(message, options?)
showWarning(message, options?)
showInfo(message, options?)
toast(options)
dismiss(id)
dismissAll()Modal
confirm(options): Promise<boolean>
alert(message, options?)
alertSuccess(message, options?)Config
configure({
position: "top-right",
duration: 4000,
animation: "slide",
theme: "light",
maxVisible: 5,
});Install & Build
npm install
npm run buildLicense
MIT
