Web platform features explorer

Declarative shadow DOM

Newly available since 2024-02-20
Tags: api html Groups: HTML DOM 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.

Specifications

Browser support (view on caniuse.com)

  • Chrome 111 Released on 2023-03-07
  • Chrome Android 111 Released on 2023-03-07
  • Edge 111 Released on 2023-03-13
  • Firefox 123 Released on 2024-02-20
  • Firefox for Android 123 Released on 2024-02-20
  • Safari 16.4 Released on 2023-03-27
  • Safari on iOS 16.4 Released on 2023-03-27

Usage (according to Chrome Platform Status)

~0.117% of page loads. More data at chromestatus.

Interop