Activity Forums Salesforce® Discussions What is lightning:accordion?

  • Nikita

    Member
    August 23, 2019 at 9:37 am

    Hi Deepak,

    A lightning:accordion component groups related content in a single container. Only one accordion section is expanded at a time by default. When you select a section, it's expanded or collapsed. Set allowMultipleSectionsOpen to allow more than one section to be opened. Each section can hold one or more Lightning components.

    This component inherits styling from accordion in the Lightning Design System.

    To additionally style this component, use the Lightning Design System helper classes.

    • This reply was modified 5 years, 2 months ago by  Nikita.
  • Saddam

    Member
    August 23, 2019 at 10:53 am

    Hi Deepak,

    Lightning: accordion component groups related content in a single container. Only one accordion section is expanded at a time by default. When you select a section, it's expanded or collapsed. Set allowMultipleSectionsOpen to allow more than one section to be opened. Each section can hold one or more Lightning components.

    This component inherits styling from accordion in the Lightning Design System.

    To additionally style this component, use the Lightning Design System helper classes.

    This example creates a basic accordion with three sections, where section B is expanded by default.

    <aura:component>
    <lightning:accordion activeSectionName="B">
    <lightning:accordionSection name="A" label="Accordion Title A">This is the content area for section A</lightning:accordionSection>
    <lightning:accordionSection name="B" label="Accordion Title B">This is the content area for section B</lightning:accordionSection>
    <lightning:accordionSection name="C" label="Accordion Title C">This is the content area for section C</lightning:accordionSection>
    </lightning:accordion>
    </aura:component>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos