# @ungap/custom-elements

> All inclusive customElements polyfill for every browser

Latest version **1.3.0** (published 2023-06-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ungap/custom-elements
pnpm add @ungap/custom-elements
yarn add @ungap/custom-elements
bun add @ungap/custom-elements
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2023-06-21 |
| First published | 2020-09-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 35 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 266 |
| Author | Andrea Giammarchi |
| Maintainers | webreflection |
| Keywords | custom, elements, polyfill, customElements |

## Links

- npm: https://www.npmjs.com/package/@ungap/custom-elements
- Repository: https://github.com/ungap/custom-elements
- Homepage: https://github.com/ungap/custom-elements#readme
- Issues: https://github.com/ungap/custom-elements/issues
- npm.io page: https://npm.io/package/@ungap/custom-elements

## Recent versions

- 1.3.0 (latest) — 2023-06-21
- 1.2.1 — 2023-06-19
- 1.2.0 — 2023-03-04
- 1.1.1 — 2022-10-19
- 1.1.0 — 2022-06-02
- 1.0.2 — 2022-03-14
- 1.0.1 — 2022-03-10
- 1.0.0 — 2021-05-05
- 0.1.15 — 2021-02-16
- 0.1.14 — 2021-02-11
- 0.1.13 — 2021-02-11
- 0.1.12 — 2021-01-20
- 0.1.11 — 2021-01-20
- 0.1.10 — 2020-11-27
- 0.1.9 — 2020-10-31
- … 10 more at https://npm.io/package/@ungap/custom-elements/versions

## README

# Custom Elements Polyfill

This module provides the [Custom Elements V1 API](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-api) as defined by standards, including the ability to [extend builtin elements](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example), 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](https://unpkg.com/@ungap/custom-elements) to obtain the _minified_ version of this module.

```html
<!-- 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.

```html
<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.

```js
// 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](https://github.com/WebReflection/custom-elements#readme) module under the [ungap](https://ungap.github.io/) umbrella.

---
_Source: https://npm.io/package/@ungap/custom-elements · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
