Event.composed is a read-only boolean that tells you whether the event will cross the shadow DOM boundary into the standard (light) DOM after reaching the shadow root (MDN). If it is false, the shadow root is the last node offered the event.
Read the notes below before you rely on this property. Prefer feature detection when support is limited.
Syntax
Use event.composed. Start with this line.
JavaScript
event.composed
Call
What it does
event.composed
Primary signature.
Built into the browser. Read event.composed on an Event instance — no import required.
Library declarations
JavaScript
event.composed
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
The current value of event.composed.
JavaScript Examples
Example 1 — Read composed on a Click
Browser UI events like click are composed — log the flag when the user clicks.
JavaScript
document.getElementById("btn").addEventListener("click", (event) => {
console.log(event.composed); // true for click
});
Open shadow.attachShadow({ mode: "open" }) creates an encapsulated tree.
Listen on the host. The light-DOM host listens for "notify".
Dispatch from inside. Options set both bubbles and composed.
Result. The event crosses the shadow root and the host handler runs. Without composed: true, the host would miss it.
Compatibility
Browser Support
Event.composed is marked Baseline Widely available on MDN (since January 2020). It is also available in Web Workers.
✓ Baseline · Widely available
Event.composed
Read-only boolean: true if the event can cross the shadow DOM boundary into the light DOM. Supported in modern browsers; not available in Internet Explorer.
95%Modern browser support
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerNo support · Legacy
No support
Event.composedExcellent
Bottom line: Safe for modern web apps and Web Components. Read event.composed; set { bubbles: true, composed: true } when synthetic events must leave a shadow tree. Use composedPath() to inspect the path.
Frequently Asked Questions
It is a read-only boolean. true means the event can cross the shadow DOM boundary into the light DOM after reaching the shadow root; false means the shadow root is the last node offered the event.
No. MDN marks Event.composed as Baseline Widely available (since January 2020). It is not Deprecated, Experimental, or Non-standard. It is also available in Web Workers.
No. Browser-dispatched UI events (click, touch, mouseover, copy, paste, and similar) are composed. Most other types are not, including synthetic events created without { composed: true }.
For normal bubbling out of the shadow tree, bubbles must also be true. MDN notes propagation across the boundary only occurs if bubbles is also true. Use composedPath() to inspect the path.
Use new Event("my-event", { bubbles: true, composed: true }), then dispatch it from inside the shadow tree when outer listeners must hear it.
event.composedPath() returns the array of objects the event travels through, including across shadow boundaries when the event is composed. Closed shadow roots may hide inner nodes from the path seen outside.