🏠 New in High Baseline Support: Declarative shadow DOM
August 20, 2026
The shadowrootmode attribute on <template> creates a shadow root without the use of JavaScript. It is a declarative alternative to the attachShadow() method.
Source features
api.HTMLTemplateElement.shadowRootMode[mdn]html.elements.template.shadowrootmode[mdn]html.elements.template.shadowrootdelegatesfocus[mdn]html.elements.template.shadowrootclonable[mdn]api.HTMLTemplateElement.shadowRootDelegatesFocus[mdn]api.HTMLTemplateElement.shadowRootClonable[mdn]api.HTMLTemplateElement.shadowRootSerializable[mdn]html.elements.template.shadowrootserializable[mdn]api.HTMLTemplateElement.shadowRootSlotAssignment[mdn]