ShadowRoot: clonable property

Baseline 2024
Newly available

Since April 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The clonable read-only property of the ShadowRoot interface returns true if the shadow root is clonable, and false otherwise.

When the value is true, a shadow host cloned with Node.cloneNode() or Document.importNode() will include a copy of the shadow root.

By default the value is false. It can be set to true using the clonable option of the Element.attachShadow() method or by setting the shadowrootclonable attribute of the <template> element that is being used to declaratively attach a shadow root.

Value

true if the shadow root is clonable, and false otherwise.

Examples

js
const host = document.createElement("div");
const shadowRoot = host.attachShadow({
  mode: "open",
  clonable: true,
});

shadowRoot.clonable;
// true

Specifications

Specification
DOM
# dom-shadowroot-clonable

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
clonable
Chrome – Full support
Chrome 124 (Release date: 2024-04-16)
footnote Full support
Edge – Full support
Edge 124 (Release date: 2024-04-18)
footnote Full support
Firefox – Full support
Firefox 123 (Release date: 2024-02-20)
footnote Full support
Opera – Full support
Opera 110 (Release date: 2024-05-14)
footnote Full support
Safari – Full support
Safari 17.4 (Release date: 2024-03-05)
footnote Full support
Chrome Android – Full support
Chrome Android 124 (Release date: 2024-04-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 123 (Release date: 2024-02-20)
footnote Full support
Opera Android – Full support
Opera Android 82 (Release date: 2024-05-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 17.4 (Release date: 2024-03-05)
footnote Full support
Samsung Internet – Full support
Samsung Internet 27 (Release date: 2024-11-06)
footnote Full support
WebView Android – Full support
WebView Android 124 (Release date: 2024-04-16)
footnote Full support
WebView on iOS – Full support
WebView on iOS 17.4 (Release date: 2024-03-05)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support