Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

webcomponentsjs

dlmma1.5kISCdeprecated1.0.2

This library is no longer maintained and reflects the v0 version of the webcomponents polyfill. Please install @webcomponents/webcomponentsjs instead for your awesome project

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

webcomponents

readme

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()] (https://developer.mozilla.org/en-US/docs/Web/API/URL/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!