status-bar
An easy drop-in status-bar vanilla custom element. No framework dependencies, small footprint.
Demo
https://nuclei.github.io/status-bar/index.html
Installation
npm install --save status-bar-component
You need the webcomponents-lite polyfill.
Load the polyfill
and the status-bar.js
in your html page or however you load you javascript dependencies:
Usage
Just drop the <status-bar>
element into you html and add your text.
Type
You can adjust the type
attribute to toggle change it between notice
, success
, warning
and error
.
A notice
Closable
If you want the status-bar
to have an x
to close it, just add the closable
attribute.
An error message.
Timeout (close after x ms)
By setting the timeout
attribute, the status bar will close itself after whatever ms
you set it to.
This self-closes after 1 second.
Icons
By default no icon will be shown, but you can add the icon
attribute to use the default icons for the current type
.
An success message.
Detached
To get a status-bar
element that is not attached to the top, add the detached
attribute.
An warning message.
Custom styling
You can change the style of the status-bar
by using the following css properties
.
/* color properties for types of status messages */--);--);--);--);/* properties for detached items *//* shadow of the item */--);/* border-radius */--