JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28436
  • Score
    100M100P100Q158079F
  • License ISC

All inclusive customElements polyfill for every browser

Package Exports

  • @ungap/custom-elements
  • @ungap/custom-elements/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ungap/custom-elements) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Custom Elements Polyfill

This module provides the Custom Elements V1 API as defined by standards, including the ability to extend builtin elements, all in ~2K minified and gzipped / brotlied.

Compatibility

The polyfill gracefully enhances the following minimum versions of at least these browsers, up to their latest version:

  • Chrome 38
  • Firefox 14
  • Opera 25
  • Internet Explorer 11 and Edge 12
  • Safari 8 and WebKit based
  • Samsung Internet 3

How To

Either install this module via npm i @ungap/custom-elements, and include it in your project, or use a CDN such as unpkg.com to obtain the minified version of this module.

<!-- this should be on top of your HTML <head> scripts -->
<script src="//unpkg.com/@ungap/custom-elements"></script>

If targeted browsers are ES2015 compatible, the es.js file would provide the same polyfill, just lighter, as no transpilation is used.

<script src="//unpkg.com/@ungap/custom-elements/es.js"></script>

If installed as module, please remember to include it on top of your main JS file.

// ESM
import '@ungap/custom-elements';

// CJS
require('@ungap/custom-elements');

The module will incrementally patch the global window/self reference, adding a customElements object that is compatible with the API.

Source Code

This module simply provides @webreflection/custom-elements module under the ungap umbrella.