Element.customElementRegistry is a read-only property that returns the CustomElementRegistry associated with this element, or null if none has been set (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.customElementRegistry. Start with this line.
JavaScript
element.customElementRegistry
Call
What it does
element.customElementRegistry
Primary signature.
Built into the browser. Read or assign el.customElementRegistry — no import required.
Library declarations
JavaScript
element.customElementRegistry
Parameters
Parameter
Description
Feature detect
Required. Property is not Baseline yet
Return Value
Return Value
Description
*
CustomElementRegistry or null
JavaScript Examples
Example 1 — Feature-Detect and Read
Check support, then read customElementRegistry on a plain element.
JavaScript
if ("customElementRegistry" in Element.prototype) {
const el = document.createElement("div");
console.log(el.customElementRegistry);
// often null, or the associated registry when set
} else {
console.log("not supported");
}
Create a scoped registry. It is a different object from customElements.
Attach and upgrade. The shadow tree uses the scoped definitions.
Match the scoped object.=== scoped is true.
Reject the global.=== customElements is false — that is the point of scoping.
Compatibility
Browser Support
Element.customElementRegistry has Limited availability (MDN: not Baseline). Tied to scoped custom element registries — supported in recent Chromium and Safari; Firefox support is incomplete.
✓ Limited availability
Element.customElementRegistry
Read-only CustomElementRegistry or null — set at creation for scoped definitions.
LimitedNot Baseline
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
customElementRegistryDetect first
Bottom line: Gate with if ("customElementRegistry" in Element.prototype). Prefer progressive enhancement; do not require scoped registries for core UX until Baseline improves.
Frequently Asked Questions
The CustomElementRegistry associated with the element, or null if none has been set. That registry decides which custom element definitions are used when the element is upgraded.
No. MDN does not mark Element.customElementRegistry as Deprecated, Experimental, or Non-standard. It has Limited availability (not Baseline) — always feature-detect.
No. It is read-only. Once a CustomElementRegistry is set on the element, it cannot be changed.
When the element is created — for example Document.createElement() with a customElementRegistry option, or when parsed inside a context that already uses a scoped registry (such as a shadow root created with that option).
window.customElements is the global registry. Element.customElementRegistry can point at that global registry or at a scoped CustomElementRegistry used only in a subtree (often a shadow tree).
So different components can define the same custom tag name without colliding in the global customElements registry.