AlertHub is a lightweight JavaScript library for creating customizable alert messages with various animations.
Install with NPM
npm install alerthub --save
Include the Css file alerthub.css in your HTML:
<link rel="stylesheet" href="path/to/alerthub.min.css">
Include the JavaScript file alerthub.js in your HTML:
<script src="path/to/alerthub.min.js"></script>
AlertHub allows you to customize various aspects of the alerts, including title, description, position, type, timeout, and more. You can also customize the appearance by modifying the CSS in your css file .
To use AlertHub,
First: Initialize the AlertHub instance:
const alertHub = new AlertHub();
secondly: call the showAlert method with the desired parameters:
alertHub.showAlert({
title: "Alert Title",
description: "This is the alert description.",
position: "top-right", // Available positions: top-right, bottom-right, top-left, bottom-left
type: "info", // Available types: primary, info, success, warning, danger, dark
timeout: 5, // Timeout in seconds (optional)
closeButton: true, // Show a close button (optional)
closeButtonSize: 20, // Size of the close button icon (optional)
animation: "fade-in", // Choose an animation: fade-in, slide-in, slide-in-right, slide-in-left (optional)
});
AlertHub provides several animation options that you can use when showing or closing alerts. You can choose from animations like "fade-in", "slide-in", "slide-in-left", "slide-in-right", and more.
To apply an animation, provide the animation name when calling showAlert:
alertHub.showAlert({
// Other parameters
animation: "slide-in-left"
});
This project is licensed under the MIT License - see the LICENSE file for details
Contributions are always welcome! Feel free to contribute to this project by submitting issues or pull requests.
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.
If you have any questions, feedback, or need assistance, feel free to reach out:
- Email: favourappps17@gmail.com
- Twitter: @favourdev
- GitHub: favourdev1
We appreciate your interest and welcome any contributions, suggestions, or bug reports!