1.0.26 • Published 4 years ago
web-component v1.0.26
web-component
Lightweight library providing interface for building web components.
Contribution
Is web-component library missing something ?
No problem! Simply fork this repository, add middleware and create pull request.
Installation
npm install --save web-component
Documentation
Package provides a decorator
function that allows you to:
- easy define Custom Elements
- styling a custom element
- creating elements from a template
- encapsulate style and markup using Shadow DOM
- extending other custom elements or even the browser's built-in HTML
import { WebComponent } from 'web-component'
@WebComponent('hello-world', {
template: require('./hello-world.html'),// provide template
styles: require('./hello-world.css'), //provide styles
extends: 'button', //default does not extends any
shadowDOM: true, //default false
mode: "open" // default open, set to closed to block access to shadowDOM
})
export class HelloWorld extends HTMLElement {}
If shadowDOM option is set to true
then template and styles will be attached to shadowRoot. If there is no shadowRoot, it will be created with mode open
.
License
The code is available under the MIT license.
1.0.26
4 years ago
1.0.25
6 years ago
1.0.24
7 years ago
1.0.23
7 years ago
1.0.22
7 years ago
1.0.21
7 years ago
1.0.19
7 years ago
1.0.18
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago