notificeJS is a JavaScript library that allows you to easily create and display notifications on your web page.
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.
- Download the library from the GitHub repository
- Extract the contents of the downloaded zip file
- Include the notifice.js file in your HTML file.
<script src="./notificeJS/notifice.js"></script>
- Install the library using npm: npm install notificeJS
- Import the library in your JavaScript file:
import notificeJS from "notifice";
To use notificeJS, you will need to create a new instance of the Notifice class, and configure it with your desired options.
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.
notification.show();
Here is an example of how you can use notificeJS to display a success notification in the top-right corner of the screen:
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:
const notification = new Notifice({
message: "An error occurred",
type: "error",
position: "bottom-left",
});
notification.show();
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.