You can download noticez to your project using npm by exectute this command
Then to import to your project and use it, run this command
Or you can download the code from here. Then add a script tag that point to the library
To create a basic notification, you will only need to specify the title
and content of the notification then let the library do the rest.
Notes:
The default background for the notification is #3498db
The default time until disappear is 3 secs
The default position is bottom right
To customize "time until disappear" of a notification,
you can specify the time
property in the options.
If you set the time to a negative number, for example: -1, the
notification will never disappear. However, it can be closed using
the canClose
option to create a close button.
To change the position of the notification, the position
property has been provided.
There are 4 different types of position:
top left
top right
bottom left
bottom right
To change the style of the notification you can add these properties
to the options
background
:
(type: string) The hex or name or rgba of the background color
textColor
:
(type: string) The hex or name or rgba of the text color
roundness
:
(type: int) The roundness of the corner in pixel (px)
font
:
(type: string) The font for both title and content
titleFont
:
(type: string) The font for just the title
contentFont
:
(type: string) The font for just the content
width
:
(type: int) The width of the notification in pixel (px)
height
:
(type: int) The height of the notification in pixel (px)
Currently there're 4 basic events:
OnMouseOver
OnMouseLeave
OnDisappear
OnClick
You can add those event to the 4th parameter
canClose
: This property will create a close
button for the notification
image
: If you want to display an image on the notification
you can use this property. This property is a string that contains link
to your desired image.
html
: This property will allow both title and content
of the notification to include html code.