# What do the bubbles and composed flags mean on a CustomEvent in LWC?

**Topic:** Lwc · **Difficulty:** Medium · **Tags:** lwc, events, bubbling

Read it on the site: https://www.forcechallenges.com/interview-questions/what-do-the-bubbles-and-composed-flags-mean-on-a-customevent-in-lwc

## Answer

By default a `CustomEvent` is **non-bubbling and non-composed**, so only a direct parent listener on the child element receives it.

- **bubbles: true** – the event travels up the DOM tree within the same shadow tree.
- **composed: true** – the event can cross the shadow boundary and propagate into parent shadow trees.

| bubbles | composed | Behaviour |
|---|---|---|
| false | false | Only handlers on the element itself |
| true | false | Bubbles within the same shadow tree |
| true | true | Bubbles and crosses shadow boundaries |

Best practice: keep events non-bubbling/non-composed unless you truly need otherwise, to avoid leaking internal events and coupling components.

---
Source: ForceChallenges · last updated 2026-10-21
