Customized built-in elements via elementInternals.type
- Category
- DOM
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
elementInternals.type supports the creation of custom elements that inherit the behaviors and properties of native HTML elements. When elementInternals.type is set to string values that represent native element types, custom elements can leverage the built-in functionality of standard elements while extending their capabilities to meet specific needs.
Motivation
Web component authors often want to create custom elements that inherit the behaviors and properties of native HTML elements. By customizing built-in elements, custom elements can leverage the built-in functionality of standard elements and extend their capabilities to meet specific needs. While this can be partially achieved by using 'extends' and 'is', they are not on a path to full interoperability due to their limitations, such as the inability to attach shadow trees to most customized built-in elements.
Standards & signals
- Firefox: Defer — No official signal yet, but no objections shared in https://github.com/openui/open-ui/issues/1088#issuecomment-2372520455
- Safari: No signal — No official signal yet, positive reception shared in https://github.com/openui/open-ui/issues/1088#issuecomment-2372520455
- Web developers: Positive — Web developers want interoperable customized built-ins. Link shows support for an alternative to implement a submit button.
- Tracking bug: https://issues.chromium.org/issues/422947646
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=customized-built-in-elements-via-elementinternals-type
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Customized%20built-in%20elements%20via%20elementInternals.type
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Customized%20built-in%20elements%20via%20elementInternals.type
- Baseline status: https://webstatus.dev/?q=Customized%20built-in%20elements%20via%20elementInternals.type
Docs: https://docs.google.com/document/d/1mEAHpBRvqWGxorJB_PIG346gc4U3I5A5SL3q9vYImxc/edit?usp=sharing
Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ElementInternalsType/explainer.md