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.
true if the shadow root is clonable, and false otherwise.
const host = document.createElement("div");
const shadowRoot = host.attachShadow({
mode: "open",
clonable: true,
});
shadowRoot.clonable;
// true
| Specification |
|---|
| DOM> # dom-shadowroot-clonable> |
| 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 |
124 | 124 | 123 | 110 | 17.4 | 124 | 123 | 82 | 17.4 | 27.0 | 124 | 17.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/clonable