notifywiz
v1.4.2
Published
A clean and easy to use notification package for Javascript projects.
Downloads
7
Readme
NotifyWiz
A clean and easy to use notification package for Javascript projects.
Installation: npm i notifywiz
Examples
"use client";
import Notifywiz from 'notifywiz';
export default function TestPage() {
async function clickHandler() {
Notifywiz.info({ position: 'bottom-right', animation: 'fade', loadingIndicator: true, message: 'This is a notification message', duration: 5000});
Notifywiz.success({ position: 'bottom-left', animation: 'fade', loadingIndicator: true, message: 'This is a notification message'});
Notifywiz.error({ position: 'left', animation: 'slide', message: 'This is a notification message'});
Notifywiz.warning({ position: 'right', animation: 'slide', message: 'This is a notification message', duration: 5000});
}
return (
<div>
<button onClick={() => clickHandler()}>Notify</button>
</div>
)
}
Parameters
/**
*
* Show a info notification.
* @param {string} title - The title of the notification. Defaults to "Type Of Notification" in the implementation.
* @param {string} message - The message of the notification.
* @param {Positions} position - The position of the notification.
* @param {number} duration - The duration of the notification. Defaults to 3000 in the implementation.
* @param {animation} animation - The animation of the notification, ('fade', 'slide', 'none') defaults to 'slide'.
* @param {boolean} loadingIndicator - The loading indicator of the notification. Defaults to false in the implementation.
* @returns {void}
*/