{"id":1666,"date":"2026-09-22T09:00:00","date_gmt":"2026-09-22T03:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/"},"modified":"2026-11-15T11:32:51","modified_gmt":"2026-11-15T06:02:51","slug":"lwc-custom-events-child-to-parent","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/","title":{"rendered":"LWC Custom Events: Child to Parent Communication Made Simple"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">LWC Custom Events are how a child component tells its parent that something happened, such as &#8220;a course was selected&#8221; or &#8220;a form was saved&#8221;. The child creates a CustomEvent, adds any data in its detail, and dispatches it. The parent listens with an on handler in its template, just like it listens to a button click.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, you will learn how to create and dispatch events, how to name them, what goes in detail, and when to use the bubbles and composed options. It builds on <a href=\"https:\/\/swapnilzambare.com\/blog\/lwc-parent-to-child-api\/\">LWC parent to child communication<\/a>, <a href=\"https:\/\/swapnilzambare.com\/blog\/lwc-loops-for-each-iterator\/\">LWC loops<\/a> and <a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-platform-events-apex\/\">Salesforce Platform Events<\/a>, which use the same publish and listen idea on the server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What are LWC Custom Events?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">LWC Custom Events are standard browser CustomEvent objects that a component fires with this.dispatchEvent. Each event has a name, such as enrol, and an optional detail object with data. The parent handles it by adding onenrol={handleEnrol} to the child tag.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of a student raising a hand in class. The student does not walk to the teacher&#8217;s desk and change the timetable. Instead, they raise a hand and say &#8220;I have a question about chapter 3&#8221;. The teacher decides what to do. The raised hand is the event, and &#8220;chapter 3&#8221; is the detail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why LWC Custom Events Matter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Data flows down with @api, but actions start in children. Here is why LWC Custom Events matter at Bright Path Tutors.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, a course card must tell the catalog when a tutor clicks Enrol.<\/li>\n\n<li>Also, a search box must tell its parent the new search text.<\/li>\n\n<li>Next, a form must report that it saved, so the parent can refresh.<\/li>\n\n<li>Children stay reusable, because they do not know who their parent is.<\/li>\n\n<li>Finally, events keep the parent in charge of shared data.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So events complete the two-way conversation between components.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How LWC Custom Events Work<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">LWC Custom Events follow a clear path. First, something happens in the child, such as a button click. Next, the child creates new CustomEvent(&#8216;enrol&#8217;, { detail: { courseId } }). Then it calls this.dispatchEvent(event). After that, the event travels to the parent, which listens with onenrol={handleEnrol} on the child tag. Finally, the parent&#8217;s handler reads event.detail and updates its own data.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-1-1024x640.png\" alt=\"LWC Custom Events diagram showing action, create, dispatch, listen and handle\" class=\"wp-image-1664\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">How an event travels from child to parent.<\/figcaption><\/figure>\n\n\n<h3 class=\"wp-block-heading\">Creating an Event<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create an event with new CustomEvent(name, options). The name is a plain string, such as enrol or search.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Naming Rules<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Event names should be lowercase, with no spaces and no hyphens or uppercase letters. Do not start the name with &#8220;on&#8221;, because the parent adds &#8220;on&#8221; when listening.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The detail Property<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">detail carries the data, such as a record Id. Prefer simple values or a copy of the data, so the parent cannot change the child&#8217;s internal objects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">bubbles and composed<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default, an event goes only to the direct parent. bubbles: true lets it rise through the parent&#8217;s own DOM, and composed: true lets it cross shadow boundaries to higher components. Use these only when you really need them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Listening in JavaScript<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A parent can also listen with addEventListener, for example in connectedCallback. However, the template on-handler is simpler and cleans up automatically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Event Options at a Glance<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The table below sums up the event options.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Option<\/th><th>Default<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td>detail<\/td><td>null<\/td><td>Carries data to the listener<\/td><\/tr><tr><td>bubbles<\/td><td>false<\/td><td>Rises through the DOM tree<\/td><\/tr><tr><td>composed<\/td><td>false<\/td><td>Crosses shadow DOM boundaries<\/td><\/tr><tr><td>cancelable<\/td><td>false<\/td><td>Lets listeners call preventDefault<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">@api Property vs Custom Event<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The table below compares the two directions of communication.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Feature<\/th><th>@api property<\/th><th>Custom event<\/th><\/tr><\/thead><tbody><tr><td>Direction<\/td><td>Parent to child<\/td><td>Child to parent<\/td><\/tr><tr><td>Carries<\/td><td>Data for display<\/td><td>News that something happened<\/td><\/tr><tr><td>Who owns data<\/td><td>Parent<\/td><td>Parent, after handling<\/td><\/tr><tr><td>Coupling<\/td><td>Child knows nothing of parent<\/td><td>Child knows nothing of parent<\/td><\/tr><tr><td>Example<\/td><td>course={course}<\/td><td>onenrol={handleEnrol}<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When to use which follows the direction. Send data down with @api properties. Send news up with LWC Custom Events.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-2-1024x640.png\" alt=\"LWC Custom Events diagram comparing @api properties and custom events\" class=\"wp-image-1665\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-diagram-2-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">@api property vs custom event.<\/figcaption><\/figure>\n\n\n<h2 class=\"wp-block-heading\">A Real LWC Custom Events Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s add LWC Custom Events to Bright Path Tutors. Each course card fires an enrol event, and the catalog keeps a running list of chosen courses.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: The Child Fires the Event<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ courseCard.js\nimport { LightningElement, api } from 'lwc';\n\nexport default class CourseCard extends LightningElement {\n    @api course;\n\n    handleEnrolClick() {\n        const evt = new CustomEvent('enrol', {\n            detail: { courseId: this.course.Id, name: this.course.Name }\n        });\n        this.dispatchEvent(evt);\n    }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- courseCard.html --&gt;\n&lt;template&gt;\n    &lt;div class=\"slds-box slds-m-bottom_small\"&gt;\n        {course.Name}\n        &lt;lightning-button label=\"Enrol\" onclick={handleEnrolClick}\n            class=\"slds-m-left_small\"&gt;&lt;\/lightning-button&gt;\n    &lt;\/div&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the tutor clicks Enrol, the card creates an enrol event. Its detail holds the course Id and name, both simple values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: The Parent Listens<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- courseCatalog.html --&gt;\n&lt;template&gt;\n    &lt;template for:each={courses} for:item=\"c\"&gt;\n        &lt;c-course-card key={c.Id} course={c} onenrol={handleEnrol}&gt;&lt;\/c-course-card&gt;\n    &lt;\/template&gt;\n    &lt;p&gt;Chosen: {chosenText}&lt;\/p&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ courseCatalog.js\nimport { LightningElement } from 'lwc';\n\nexport default class CourseCatalog extends LightningElement {\n    courses = [\n        { Id: 'a01A', Name: 'Apex Basics' },\n        { Id: 'a01B', Name: 'SOQL Basics' }\n    ];\n    chosen = [];\n\n    handleEnrol(event) {\n        const { courseId, name } = event.detail;\n        if (!this.chosen.some(c =&gt; c.courseId === courseId)) {\n            this.chosen = [...this.chosen, { courseId, name }];\n        }\n    }\n\n    get chosenText() {\n        return this.chosen.length ? this.chosen.map(c =&gt; c.name).join(', ') : 'None yet';\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The parent listens with onenrol on each card. Then handleEnrol reads the detail, skips duplicates, and assigns a new array, so the text updates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: See It Work<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is what the catalog shows after clicking Enrol on both cards.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Apex Basics [Enrol]\nSOQL Basics [Enrol]\nChosen: Apex Basics, SOQL Basics<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The cards never touched the parent&#8217;s list. They only announced what happened.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">LWC Custom Events with bubbles and composed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If a grandparent needs the event, you could set bubbles: true and composed: true. However, that exposes the event to the whole page. A cleaner pattern is for the parent to handle the event and fire its own event upward. For unrelated components, use Lightning Message Service, which a later post covers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with LWC Custom Events<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Naming events with uppercase letters or hyphens.<\/li>\n\n<li>Starting the event name with &#8220;on&#8221;, such as onenrol.<\/li>\n\n<li>Passing the child&#8217;s internal objects in detail.<\/li>\n\n<li>Turning on bubbles and composed by default.<\/li>\n\n<li>Changing the parent&#8217;s data from the child instead of firing an event.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for LWC Custom Events<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use short, lowercase, meaningful event names.<\/li>\n\n<li>Put only the data the parent needs in detail.<\/li>\n\n<li>Keep bubbles and composed off unless truly needed.<\/li>\n\n<li>Handle events in the template with on-handlers.<\/li>\n\n<li>Use Lightning Message Service for unrelated components.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Practice Task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add a remove event to each chosen course in the parent&#8217;s list, so a small child chip can ask the catalog to remove it. Hint: create a chip component that fires remove with the courseId, and filter the array in the parent.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Most Asked Interview Questions on LWC Custom Events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Event questions appear in almost every LWC interview. Here are the 21 questions asked most about LWC Custom Events.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Basic Questions on LWC Custom Events<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q1: How does a child send data to a parent in LWC?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It dispatches a CustomEvent with the data in detail, and the parent handles it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q2: How do you create a custom event?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use new CustomEvent(&#8216;name&#8217;, { detail: data }).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q3: How do you fire it?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Call this.dispatchEvent(event) in the child.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q4: How does the parent listen?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It adds on plus the event name on the child tag, such as onenrol={handleEnrol}.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q5: Where is the event data?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In event.detail.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q6: What are the naming rules for events?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use lowercase letters with no spaces, hyphens or &#8220;on&#8221; prefix.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q7: Does an event bubble by default?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No, so it reaches only the direct parent unless you set bubbles.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code and Scenario Questions on LWC Custom Events<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q8: What does composed: true do?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It lets the event cross shadow DOM boundaries to higher components.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q9: Why avoid putting objects in detail?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because the parent could change them, so send primitives or a copy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q10: How do you pass two values in one event?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Put both in an object, such as detail: { courseId, name }.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q11: Can a parent listen with JavaScript instead of markup?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, with addEventListener, but you must remove the listener yourself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q12: How do you reach a grandparent?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Have the parent handle the event and fire a new one, or use bubbles and composed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q13: How do unrelated components communicate?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They use Lightning Message Service instead of DOM events.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q14: What is event.target in a parent handler?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is the child component that dispatched the event.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Advanced Questions on LWC Custom Events<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q15: Why keep bubbles and composed off by default?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because events then stay private, so other components cannot rely on them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q16: What does cancelable do?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It lets listeners call preventDefault, so the child can check if an action was cancelled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q17: Can an event carry a function?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It can, but it is a poor pattern, so send data instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q18: How do Aura parents handle LWC events?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They use an on-attribute in the Aura markup and read event.getParam(&#8216;&#8230;&#8217;) for detail values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q19: How do you test that a component fires an event?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Jest, add a listener to the element, click the button, and assert the handler was called.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q20: Why is one-way data flow with events useful?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because only the parent changes shared data, so bugs are easier to trace.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q21: When would you choose LMS over events?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the components are not in the same parent and child chain, such as utility bar items.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/events-create-dispatch.html\" target=\"_blank\" rel=\"noopener noreferrer\">Create and Dispatch Events (LWC Developer Guide)<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/events-propagation.html\" target=\"_blank\" rel=\"noopener noreferrer\">Configure Event Propagation (LWC Developer Guide)<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LWC Custom Events send news from a child to its parent.<\/li>\n\n<li>Create them with new CustomEvent and fire them with dispatchEvent.<\/li>\n\n<li>Use lowercase names without the &#8220;on&#8221; prefix.<\/li>\n\n<li>The parent listens with on plus the event name and reads event.detail.<\/li>\n\n<li>Keep bubbles and composed off unless truly needed.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some components are not parent and child at all. Next, read our guide to <a href=\"https:\/\/swapnilzambare.com\/blog\/lightning-message-service-lwc\/\">Lightning Message Service in LWC<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LWC Custom Events are how a child component tells its parent that something happened, such as &#8220;a course was selected&#8221; or &#8220;a form was&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1663,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[245,8,96],"tags":[26,113],"swapz_series":[],"class_list":["post-1666","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lightning-web-components","category-salesforce","category-salesforce-developer","tag-intermediate","tag-lwc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LWC Custom Events: Child to Parent Communication<\/title>\n<meta name=\"description\" content=\"LWC Custom Events explained simply: CustomEvent, dispatchEvent, detail, naming rules, bubbles and composed, handling in the parent and 21 interview Q&amp;A.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LWC Custom Events: Child to Parent Communication\" \/>\n<meta property=\"og:description\" content=\"LWC Custom Events explained simply: CustomEvent, dispatchEvent, detail, naming rules, bubbles and composed, handling in the parent and 21 interview Q&amp;A.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-22T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-15T06:02:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"LWC Custom Events: Child to Parent Communication Made Simple\",\"datePublished\":\"2026-09-22T03:30:00+00:00\",\"dateModified\":\"2026-11-15T06:02:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/\"},\"wordCount\":1525,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/lwc-custom-events-child-to-parent-featured.png\",\"keywords\":[\"Intermediate\",\"LWC\"],\"articleSection\":[\"Lightning Web Components\",\"Salesforce\",\"Salesforce Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/\",\"name\":\"LWC Custom Events: Child to Parent Communication\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/lwc-custom-events-child-to-parent-featured.png\",\"datePublished\":\"2026-09-22T03:30:00+00:00\",\"dateModified\":\"2026-11-15T06:02:51+00:00\",\"description\":\"LWC Custom Events explained simply: CustomEvent, dispatchEvent, detail, naming rules, bubbles and composed, handling in the parent and 21 interview Q&A.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/lwc-custom-events-child-to-parent-featured.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/lwc-custom-events-child-to-parent-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"LWC Custom Events featured image: title card with an LWC code example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/lwc-custom-events-child-to-parent\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LWC Custom Events: Child to Parent Communication Made Simple\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LWC Custom Events: Child to Parent Communication","description":"LWC Custom Events explained simply: CustomEvent, dispatchEvent, detail, naming rules, bubbles and composed, handling in the parent and 21 interview Q&A.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/","og_locale":"en_US","og_type":"article","og_title":"LWC Custom Events: Child to Parent Communication","og_description":"LWC Custom Events explained simply: CustomEvent, dispatchEvent, detail, naming rules, bubbles and composed, handling in the parent and 21 interview Q&A.","og_url":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-09-22T03:30:00+00:00","article_modified_time":"2026-11-15T06:02:51+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-featured.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"LWC Custom Events: Child to Parent Communication Made Simple","datePublished":"2026-09-22T03:30:00+00:00","dateModified":"2026-11-15T06:02:51+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/"},"wordCount":1525,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-featured.png","keywords":["Intermediate","LWC"],"articleSection":["Lightning Web Components","Salesforce","Salesforce Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/","url":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/","name":"LWC Custom Events: Child to Parent Communication","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-featured.png","datePublished":"2026-09-22T03:30:00+00:00","dateModified":"2026-11-15T06:02:51+00:00","description":"LWC Custom Events explained simply: CustomEvent, dispatchEvent, detail, naming rules, bubbles and composed, handling in the parent and 21 interview Q&A.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-featured.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/lwc-custom-events-child-to-parent-featured.png","width":2400,"height":1260,"caption":"LWC Custom Events featured image: title card with an LWC code example"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/lwc-custom-events-child-to-parent\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"LWC Custom Events: Child to Parent Communication Made Simple"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=1666"}],"version-history":[{"count":1,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1666\/revisions"}],"predecessor-version":[{"id":2319,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1666\/revisions\/2319"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/1663"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=1666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=1666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=1666"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=1666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}