lwc custom accordion expandable/collapsible section -- w3web.net

How to create custom expandable/collapsible accordion section uses of lightning-accordion tags in Lightning Web Components — LWC | How to create custom expandable/collapsible section in lwc

551 views

Hey guys, today in this post we are going to learn about how to create custom expandable/collapsible accordion section uses of lightning-accordion tags in LWC (Lightning web components).

Here I am display a vertically lightning-accordion sections of content that you can expand and collapse.

Click a section’s vertically tab to expand its related content. You can control the visible only one section at a time.

Files we used in this post example

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

Final Output

custom accordion 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 ➡ lwcAccordionSection.html

SFDX:Lightning Web Component ➡ New ➡ lwcAccordionSection.html

lwcAccordionSection.html [Lightning Web Component HTML]

Create Lightning Web Component Javascript

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

SFDX:Lightning Web Component ➡ New ➡ lwcAccordionSection.js

lwcAccordionSection.js [LWC JavaScript File]

Create Lightning Web Component Meta XML

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

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

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

Create Lightning Web Component Style CSS

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

SFDX:Lightning Web Component ➡ New ➡ lwcAccordionSection.css

lwcAccordionSection.css [Style CSS]

Create Lightning Application

Step 5:- Create Lightning Application : lwcAccordionSectionApp.app

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

lwcAccordionSectionApp.app [Component Application File]

lwc custom accordion expandable/collapsible section -- www.w3web.net

Further post that would you like to learn in LWC

 

 

FAQ (Frequently Asked Questions)

Why is collapsed by default greyed out?

Why is collapsed by default greyed out? Place the cursor in a heading formatted with the heading level you want to collapse (such as Heading 1) and click the 'Paragraph Settings' dialog box button in the “Paragraph” section of the “Home” tab.

What are the three different custom tabs you can create?

You can create three different kinds of custom tabs: custom object tabs, Web tabs, and Visualforce page tabs. Custom object tabs allow you to find, add, change, and delete the data in your custom objects.

How do I remove the Expand Group collapse folder?

Open File Explorer and navigate to the folder where you wish to disable file grouping. Right-click anywhere in the folder. Select Group by > None.

Related Topics | You May Also Like

  • Your reaction of the article ▾
 

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] | | The Sitemap where you can find all published post on w3web.net

11 thoughts on “How to create custom expandable/collapsible accordion section uses of lightning-accordion tags in Lightning Web Components — LWC | How to create custom expandable/collapsible section in lwc”

Leave a Comment