All Projects → shystruk → notification-service-js

shystruk / notification-service-js

Licence: MIT license
🚦Notification Service based on Custom Elements

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to notification-service-js

Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+75856.25%)
Mutual labels:  webcomponents, custom-elements
web-components
A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
Stars: ✭ 322 (+1912.5%)
Mutual labels:  webcomponents, custom-elements
Markuplint
A Linter for All Markup Languages.
Stars: ✭ 193 (+1106.25%)
Mutual labels:  webcomponents, custom-elements
Nutmeg
Build, test, and publish vanilla Web Components with a little spice
Stars: ✭ 111 (+593.75%)
Mutual labels:  webcomponents, custom-elements
api-viewer-element
API documentation and live playground for Web Components. Based on Custom Elements Manifest format
Stars: ✭ 222 (+1287.5%)
Mutual labels:  webcomponents, custom-elements
Vaadin Combo Box
The Web Component for displaying a list of items with filtering. Part of the Vaadin components.
Stars: ✭ 113 (+606.25%)
Mutual labels:  webcomponents, custom-elements
Standalone
Create framework agnostic components that are truly reusable and interoperable with all the benefits of the React ecosystem – using the HTML5 custom elements API to extend HTML's vocabulary.
Stars: ✭ 205 (+1181.25%)
Mutual labels:  webcomponents, custom-elements
Stencil
A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
Stars: ✭ 9,880 (+61650%)
Mutual labels:  webcomponents, custom-elements
paper-chip
A chip web component made with Polymer 2 following Material Design guidelines
Stars: ✭ 30 (+87.5%)
Mutual labels:  webcomponents, custom-elements
MoleculeJS
A library for creating fast and reactive Custom Elements
Stars: ✭ 39 (+143.75%)
Mutual labels:  webcomponents, custom-elements
material-webcomponents
Material Design implemented in Web Components (Custom Elements v1)
Stars: ✭ 110 (+587.5%)
Mutual labels:  webcomponents, custom-elements
smart-webcomponents-community
Material & Bootstrap Web Components built with Smart
Stars: ✭ 30 (+87.5%)
Mutual labels:  webcomponents, custom-elements
Vanilla Hamburger
Animated hamburger menu icons for modern web apps (1.8 KB) 🍔
Stars: ✭ 110 (+587.5%)
Mutual labels:  webcomponents, custom-elements
Api Viewer Element
API documentation and live playground for Web Components
Stars: ✭ 121 (+656.25%)
Mutual labels:  webcomponents, custom-elements
Calcite Components
Web Components for the Calcite Design System. Built with Stencil JS. Currently in Beta!
Stars: ✭ 96 (+500%)
Mutual labels:  webcomponents, custom-elements
Hybrids
Extraordinary JavaScript framework with unique declarative and functional architecture
Stars: ✭ 2,529 (+15706.25%)
Mutual labels:  webcomponents, custom-elements
Redux Store Element
A custom element allowing a more declarative use of Redux.
Stars: ✭ 83 (+418.75%)
Mutual labels:  webcomponents, custom-elements
Aybolit
Lightweight web components library built with LitElement.
Stars: ✭ 90 (+462.5%)
Mutual labels:  webcomponents, custom-elements
pattern-library
AXA CH UI component library. Please share, comment, create issues and work with us!
Stars: ✭ 103 (+543.75%)
Mutual labels:  webcomponents, custom-elements
svelte-webcomponent-boilerplate
🏗 Create your HTML5 Web Component with Svelte. Made your web components with this user-friendly boilerplate
Stars: ✭ 58 (+262.5%)
Mutual labels:  webcomponents, custom-elements

Notification Service Twitter URL

Published on webcomponents.org MIT Licence npm version Known Vulnerabilities

Notification Service provides a simple show/hide message. It is based on CustomElements and may be integrated with any framework. Push notification works through CustomEvent dispatcher. Notification Service supports all popular browsers, including Internet Explorer 11, although some polyfills are required for IE 11. Please see here.

Installation

npm

npm install notification-service-js

yarn

yarn add notification-service-js

Usage

// As a module
import 'notification-service-js'

// As a <script> tag
<script src="node_modules/notification-service-js/build/notification-service.js"></script>

// Insert web component into the DOM
<notification-service></notification-service>

Push notification

CustomEvent.DISPATCH('WEB_COMP_SHOW_NOTIFICATION', {
    type: 'success', // success, error, warning
    message: 'Your message has been sent',
    timer: 3000 // default 5000, not required
})

Options

CustomEvent.DISPATCH('EVENT_NAME', options)

type

Type: string
Values: success, error, warning

A class which will be added to the notification content .web-nc-content.<type>. Depends on the class CSS styles will be applied to the content. You can add your own type and add styles through the prop cross-img-src.

message

Type: string

Content which will be displayed inside notification.

timer

Type: number
Default: 5000

Time in milliseconds how long notification will be showing.

Props

cross-img-src

The path to an image (png/svg/jpg) file, which will be used for a cross icon.

<notification-service cross-img-src="../images/cross.svg"></notification-service>

style-src

The path to .css file, which will be pasted after common styles.

<notification-service style-src="build/style.css"></notification-service>

Contributing

Any contributions you make are greatly appreciated.

Please read the Contributions Guidelines before submitting a PR.

License

MIT © Vasyl Stokolosa

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].