webcomponentsjs

The popular WebComponents polyfill in a nice, frequently updated NPM package


Keywords
webcomponents
License
ISC
Install
npm install webcomponentsjs@1.0.2

Documentation

webcomponentsjs NPM version

The popular WebComponents polyfill in a nice, frequently updated NPM package.

Usage

Install webcomponentsjs as a dependency:

npm install webcomponentsjs

The polyfill traditionally comes in two standard sizes and this version adds an additional one that is significantly smaller!

full

includes the Custom Elements, HTML Imports, Shadow DOM and Templates polyfills. (260kb)

lite

includes everything from the full polyfill except for the Shadow DOM. (79kb)

micro

Includes polyfills for only Custom Elements and Templates. NOTE: The micro package doesn't include the polyfill for the URL() object because they were only needed for the HTMLImports polyfill. (40kb)

To use it, import it as a dependency from your code:

import "webcomponentsjs"

If you want to load the lite or micro versions, use:

import "webcomponentsjs/lite"

or

import "webcomponentsjs/micro"

That's it!