Scoped Custom Element Registries Reach Baseline

Firefox 159 shipped on October 27, 2026 with support for scoped custom element registries. With Chrome 146, Edge 146 and Safari 26 already shipping it, the feature became Baseline Newly available in October 2026. That moves the oldest practical obstacle in web components — name collisions — from a convention every team has to remember, to something the platform resolves declaratively.

The problem: one registry for the whole page

Until now there was a single global registry behind window.customElements. Anything defined there is visible to the entire page, and a name can never be registered twice:

js
customElements.define("date-picker", PickerA);
customElements.define("date-picker", PickerB);
// NotSupportedError: the name is already in use

The constraint looks mild on paper and turns painful in any application of real size. Two component libraries, each shipping an element called date-picker. A micro-frontend loading another team's bundle into the same page, with no authority over the names that team picked. Or — the sharpest case — an incremental migration of an internal design system, where the old and new versions of the same component must run side by side for the length of the transition.

The established answers were all workarounds. Name prefixes like acme-date-picker work, but they are a convention the platform does not enforce: one team forgetting is enough to bring the collision back. Build-time renaming pushes the problem into the tooling layer and makes what runs in the browser harder to trace. Full isolation in an iframe genuinely works, but it costs memory, forces asynchronous cross-frame communication, and makes styling and event propagation awkward. Each treats the symptom. The cause was that the naming scope was necessarily global.

What changed

You can now create a fully independent registry and attach it to a single shadow tree. Definitions inside it are invisible outside that tree, and a node with a scoped registry uses it for all of its operations:

js
const registry = new CustomElementRegistry();

registry.define(
  "date-picker",
  class extends HTMLElement {
    connectedCallback() {
      this.textContent = "v2";
    }
  },
);

const host = document.createElement("div");
document.body.append(host);

const shadow = host.attachShadow({
  mode: "open",
  customElementRegistry: registry,
});

shadow.innerHTML = "<date-picker></date-picker>";

console.log(shadow.customElementRegistry === registry); // true
console.log(shadow.querySelector("date-picker").textContent); // "v2"

Here date-picker resolves inside this tree only. A neighbouring tree can carry the same name with an entirely different definition, with no collision and not a single prefix. Two versions of one component coexist on the page, each living in the tree it was bound to.

For standalone nodes outside a shadow tree there is an equivalent option at creation time:

js
const element = document.createElement("date-picker", {
  customElementRegistry: registry,
});

The spec also provides two methods for the less tidy cases. registry.initialize(root) binds a registry to a tree that already exists, updating every node inside it that has no registry yet — the practical path for markup that arrived from the server or from a prepared template. And registry.upgrade(root) upgrades elements created before their definition landed, skipping nodes already bound to a different registry.

Real-world caveats

The binding is permanent. customElementRegistry on a shadow root is read-only, and once set it cannot be changed. This is an architectural decision made the moment the tree is created, with nothing swapped later at runtime. The spec notes the restriction is intentional, not an implementation gap.

Passing the global registry fails. attachShadow accepts null or a registry built with the constructor. Passing window.customElements throws NotSupportedError, so there is no "use the global one explicitly" path.

Customized built-ins are not supported. Calling define() with the extends option on a scoped registry throws NotSupportedError. Anything relying on extending built-in elements stays on the global registry.

Compatibility data is still inconsistent. The Baseline badge on the constructor reads Newly available since October 2026, while MDN's ShadowRoot.customElementRegistry page still carries Limited availability. MDN itself warns that compatibility data lags for very recent releases, so feature-detect before depending on it:

js
const scoped = "customElementRegistry" in ShadowRoot.prototype;

Newly available is not every user. Baseline Newly available describes the latest browser versions, not what is actually installed across your audience. Prefixes stay a valid fallback for a while, and the sound move is code that works either way. Anyone currently relying on component isolation inside an iframe now has a far lighter alternative for the cases where the isolation existed only because of names.

Takeaway

Custom element name collisions were, for years, a tax paid by every application that combined more than one source of components. With scoped registries at Baseline, naming scope becomes a declarative decision made when the tree is created, rather than a convention enforced through code review and vigilance. For teams building design systems, integrating third-party components, or running a gradual migration between two versions, that is an entire layer of complexity removed from the architecture.

Primary source: HTML Standard — Custom elements API and MDN: CustomElementRegistry() constructor.