README
Notify
Small notifications library
Demo
https://buzz-notify-henna.vercel.app/
Install
https://cdn.jsdelivr.net/npm/@reliutg/buzz-notify/index.min.js
or
USAGE no npm install needed!
<script type="module">
import Notify from "https://cdn.skypack.dev/@reliutg/buzz-notify";
</script>
How to use
In myawesomesite.html:
<div id="notify"></div>
In myscript.js:
Notify({ title: "My notification" });
Styles
type
property require a string. Can be 'success', 'danger', 'warning'
Notify({ title: "My notification", type: "success" });
Position
position
property requires a string with 2 keywords for vertical and horizontal postion.
Format: <vertical> <horizontal>
.
- Vertical options:
top
,bottom
- Horizontal options:
left
,center
,right
Default is "top right".
API
Notify({
// (optional)
// Can be 'success', 'danger', 'warning'
// Overrides default/provided type
type: "success",
// (optional)
// Notification position
// Overrides default/provided duration
position: "top right",
// (optional)
// Title
title: "This is title",
// (optional)
// Content
html: "This is <b> content </b>",
// (optional)
// Set in ms (milliseconds) If the duration is a negative number, the notification will not be removed.
duration: 2000,
});