Web features explorer

Declarative shadow DOM

Newly available since 2024-02-20
Tags: api html Groups: HTML Web Components

The shadowrootmode attribute on <template> creates a shadow root without the use of JavaScript. It is a declarative alternative to the attachShadow() method. To learn more, see <template>: The Content Template element at MDN.

Compatibility (view on caniuse.com)