X-Notification is an HTML5 Custom Element derived from the awesome Codrops demo.
For browsers who don't support custom elements natively, You're gonna need to import a polyfill :(
class XNotification extends HTMLElement {
dismiss()
static create(message: string, options: Object{type: string, autoremove: boolean})
}
Attributes other than message
are optional.
<x-notification message="A Message" autoremove="false" type="notice"></x-notification>
const notification = XNotification.create("A Notification")
setTimeout(function(){
notification.dismiss()
}, 25e2)
This project is licensed under the terms of MIT License. See the License file for more info.