CustomElementRegistry - Web APIs | MDN

Instance methods

CustomElementRegistry.define()

Defines a new custom element.

CustomElementRegistry.get()

Returns the constructor for the named custom element, or undefined if the custom element is not defined.

CustomElementRegistry.getName()

Returns the name for the already-defined custom element, or null if the custom element is not defined.

CustomElementRegistry.upgrade()

Upgrades a custom element directly, even before it is connected to its shadow root.

CustomElementRegistry.whenDefined()

Returns an empty Promise that resolves when a custom element becomes defined with the given name. If such a custom element is already defined, the returned promise is immediately fulfilled.

Examples

See the Examples section in our guide to using custom elements.

Specifications

Specification
HTML
# custom-elements-api

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.