notifice
v1.2.2
Published
NotificeJS is a lightweight and easy-to-use library for creating customizable notifications in your web applications. With a simple and intuitive API, you can easily create notifications with custom messages, styles, and behavior. Whether you need to disp
Downloads
6
Maintainers
Readme
notificeJS
notificeJS is a JavaScript library that allows you to easily create and display notifications on your web page.
Installation
To use notificeJS, you will need to include the library in your project. You can do this by either downloading the library from the GitHub repository, or by using a package manager like npm.
Downloading the Library
- Download the library from the GitHub repository
https://github.com/DipankajSingh/notifice.js
- Extract the contents of the downloaded zip file
- Include the notificeJS.js file in your HTML file.
HTML
<script src="./notificeJS/notificeJS.js"></script>
Using NPM
- Install the library using npm: npm install notificeJS
- Import the library in your JavaScript file:
javascript
import notificeJS from "notificeJS";
Usage
To use notificeJS, you will need to create a new instance of the Notifice class, and configure it with your desired options.
javascript
const notification = new Notifice({
message: "Hello, World!",
type: "success",
position: "top-right",
});
The Notifice class accepts an options object, which can contain the following properties:
- message: The message to be displayed in the notification.
- type: The type of notification to be displayed. This can be one of: success, info, warning, or error.
- position: The position on the screen where the notification should be displayed. This can be one of: top-left, top-right, bottom-left, or bottom-right.
Once you have created a new instance of the Notifice class, you can display the notification by calling the show() method.
javascript
notification.show();
Examples
Here is an example of how you can use notificeJS to display a success notification in the top-right corner of the screen:
javascript
const notification = new Notifice({
message: "Task completed successfully!",
type: "success",
position: "top-right",
});
notification.show();
And here is an example of how you can display an error notification in the bottom-left corner of the screen:
javascript
const notification = new Notifice({
message: "An error occurred",
type: "error",
position: "bottom-left",
});
notification.show();
Conclusion
notificeJS is a simple and easy-to-use library for creating and displaying notifications on your web page. With its flexibility and customizable options, notificeJS is a great tool for adding notifications to your web projects.