2.1.1 • Published 4 years ago

x-notification v2.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

<x-notification>

Declarative Browser Notification as Web Components.

Build Status NPM version devDependency Status

Install

Using npm:

$ npm install x-notification

Usage

Import XNotification and register it.

<script type="module">
import XNotification from 'https://unpkg.com/x-notification';

customElements.define('x-notification', XNotification);
</script>

Put <x-notification> tag.

<x-notification autoshow title="Notification Title" delay="1000" timeout="3000" tag="tag">
  Notification body
</x-notification>

If you set autoshow attribute, a notification will be shown automatically.

To show it manually, execute show() function.

document.querySelector('x-notification').show();

Attributes

title=<String>

This is a required option . This will be set as notification title.

dir=<String>

The direction of the notification. It can be auto , ltr , or rtl .

lang=<String>

Specify the language used within the notification.

body=<String>

A string representing an extra content to display within the notification.

tag=<String>

An ID for a given notification that allows to retrieve, replace or remove it if necessary.

icon=<String>

The URL of an image to be used as an icon by the notification.

delay=<Number>

Delay for timing to show notification.

timeout=<Number>

Timeout for timing to close notification automatically.

autoshow

If you add this attribute, notification will be shown automatically.

License

MIT © Shogo Sensui

2.1.1

4 years ago

2.1.0

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.4.1

9 years ago

0.4.0

10 years ago

0.3.2

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago