Passing the color code value from lwc child to aura component -- w3web.net

How to pass the color code value from a child LWC component to parent lightning aura component using LWC Custom Event & Dispatch Event

Hey guys, today in this post we are going to learn about How to pass the color code value from a Child LWC Component to Parent Lightning Aura Component using LWC Dispatched Event.

Files we used in this post example:-

colorPickerLwc.html Lightning Web Component HTML It is child component and calling into colorPickerLwcCmp.cmp.
colorPickerLwc.js Lightning Web Component JavaScript It is holding ColorPicker function with Custom Event & Dispatch Event and sending the color value to Aura Component.
colorPickerLwcCmp.cmp Lightning Web Component HTML It is Parent Aura Component and it’s hold Form Input field and color value that is getting from child component..
colorPickerLwcCmpController.js Lightning Web Component JavaScript It is holding colorBgApply function and it is used for set the color value into input field label and border box.
colorPickerLwcApp.app Component Application It is used for call the parent component to preview on browser.

Live Demo

Passing the color code value from lwc child to aura component -- w3web.net

Other related post that would you like to learn in LWC

Step 1:- Create Lightning Web Component : colorPickerLwc.html

SFDX:Lightning Web Component >> New >> colorPickerLwc.html

colorPickerLwc.html [Lightning Web Component HTML]

Step 2:- Create Lightning Web Component : colorPickerLwc.js

SFDX:Lightning Web Component >> New >> colorPickerLwc.js

colorPickerLwc.js [LWC JavaScript File]

Step 3:- Create Lightning Web Component : colorPickerLwc.js-meta.xml

SFDX:Lightning Web Component >> New >> colorPickerLwc.js-meta.xml

colorPickerLwc.js-meta.xml [LWC Meta Data XML]

Create Lightning Component and Controller

Step 4:- Create Lightning Component : colorPickerLwcCmp.cmp

From Developer Console >> File >> New >> Lightning Component

colorPickerLwcCmp.cmp [Lightning Component File]

Step 5:- Create Lightning Component : colorPickerLwcCmpController.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Controller

colorPickerLwcCmpController.js [JavaScript Controller]

Create Lightning Application

Step 6:- Create Lightning Application : colorPickerLwcApp.app

From Developer Console >> File >> New >> Lightning Application

colorPickerLwcApp.app [Component Application File]

Passing the color code value from lwc child to aura component -- w3web.net

Further post that would you like to learn in LWC

3 thoughts on “How to pass the color code value from a child LWC component to parent lightning aura component using LWC Custom Event & Dispatch Event”

Leave a Comment

Please Contribute to Support If Some Value Added in Your Project or Website