lightning:accordion multiple open sections in lwc -- www.w3web.net

Create custom Expandable/Collapsible & Toggle accordion open multiple section uses of lightning-accordion tags in Lightning web components — LWC | How to create lightning-accordion multiple section in lwc

Hey guys, today in this post we are going to learn about how Create custom expandable/collapsible and toggle accordion open multiple section uses of lightning-accordion tags in Lightning web components — LWC.

Here I am creating a vertically lightning-accordion multiple open sections where we can Expand/Collapse & Toggle the section One or Multiple Section at a time.

Click a vertically tab for Expand/Collapse and Toggle content section. You can control the visible multiple section one-by-one.

Files we used in this post example

lwcAccordionMultipleSection.html Lightning Web Component HTML Template HTML file for used to write HTML element for user interface.
lwcAccordionMultipleSection.js Lightning Web Component JavaScript It is holding onclick functionality for Create Custom Expandable/Collapsible & Toggle Section.
lwcAccordionMultipleSection.js-meta.xml XML Meta File It is used for where this lightning web component you want to exposed.
lwcAccordionMultipleSection.css Style CSS File It is used for fixed the alignmet issues of Expandable/Collapsible box and Image.

Final Output

expand/collapse and toggle section in lwc -- www.w3web.net

Other related post that would you like to learn in LWC

Create Lightning Web Component HTML

Step 1:- Create Lightning Web Component HTML ➡ lwcAccordionMultipleSection.html

SFDX:Lightning Web Component ➡ New ➡ lwcAccordionMultipleSection.html

lwcAccordionMultipleSection.html [Lightning Web Component HTML]

Create Lightning Web Component Javascript

Step 2:- Create Lightning Web Component Javascript ➡ lwcAccordionMultipleSection.js

SFDX:Lightning Web Component ➡ New ➡ lwcAccordionMultipleSection.js

lwcAccordionMultipleSection.js [LWC JavaScript File]

Create Lightning Web Component Meta XML

Step 3:- Create Lightning Web Component Meta XML ➡ lwcAccordionMultipleSection.js-meta.xml

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

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

Create Lightning Web Component Style CSS

Step 4:- Create Lightning Web Component Style CSS ➡ lwcAccordionMultipleSection.css

SFDX:Lightning Web Component ➡ New ➡ lwcAccordionMultipleSection.css

lwcAccordionMultipleSection.css [Style CSS]

Create Lightning Application

Step 5:- Create Lightning Application : lwcAccordionMultipleSectionApp.app

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

lwcAccordionMultipleSectionApp.app [Component Application File]

lightning:accordion multiple open sections in lwc -- www.w3web.net

Further post that would you like to learn in LWC

Related Topics | You May Also Like

Hi, This is Vijay behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio]

7 thoughts on “Create custom Expandable/Collapsible & Toggle accordion open multiple section uses of lightning-accordion tags in Lightning web components — LWC | How to create lightning-accordion multiple section in lwc”

Leave a Comment