The read-only composed property of the Event interface returns a Boolean which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM.

Note: This property was formerly named scoped.


var composed = Event.composed;


Boolean which is true if the event will cross from the shadow DOM into the standard DOM after reaching the shadow root (that is, the first node in the shadow DOM in which the event began to propagate). All UA-dispatched UI events are composed (click/touch/mouseover/copy/paste, etc.) — most other types of events are not composed and so will return false, for example synthetic events that have been created without their composed option being set to true.

Propagation only occurs at all if the bubbles property is also true. You can determine the path the event will follow as it makes its way through the shadow root to the DOM root by calling composedPath().

If this value is false, the shadow root will be the last node to be offered the event.


In our composed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert it into the element's shadow DOM as the text content of a <p> element. The only difference between the two is that their shadow roots are attached with mode set to open and closed respectively.

The first definition looks like this, for example:

  class extends HTMLElement {
    constructor() {

      let pElem = document.createElement('p');
      pElem.textContent = this.getAttribute('text');

      let shadowRoot = this.attachShadow({mode: 'open'})


We then insert a one of each element into our page:

<open-shadow text="I have an open shadow root"></open-shadow>
<closed-shadow text="I have a closed shadow root"></closed-shadow>

And the include a click event listener on the <html> element:

document.querySelector('html').addEventListener('click',function(e) {

When you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things — first, the composed property will return true beause the click event is always able to propagate across shadow boundaries. Second, you'll notice a difference in the value of composedPath for the two elements. The <open-shadow> element's composed path is this:

Array [ p, ShadowRoot, open-shadow, body, html, HTMLDocument https://mdn.github.io/web-components-examples/composed-composed-path/, Window ]

Whereas the <closed-shadow> element's composed path is a follows:

Array [ closed-shadow, body, html, HTMLDocument https://mdn.github.io/web-components-examples/composed-composed-path/, Window ]

In the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary.



Specification Status Comment
The definition of 'composed' in that specification.
Living Standard  

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 53.0 ? 52 (52) ? ? ?
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support No support 53.0 52.0 (52) ? ? ? 53.0

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, Sheppy, jpmedley
 Last updated by: chrisdavidmills,