RzAccordion
RzAccordions allow you to organize a stack of items that can be expanded or collapsed, revealing or hiding additional content. RzAccordion examples use the Alpine JS's collapse plugin, which provides a smooth collapse/expand animation. If you prefer not to use this plugin, you can remove the "x-collapse" directive from each item, but you will lose this animation. In this example, In this example, The following table summarizes the key parameters for the RzAccordion component. The following table summarizes the key parameters for the AccordionItem component. This page uses the Type is set to AccordionType.Multiple, so more than one section can be expanded at once.<RzAccordion Type="AccordionType.Multiple">
<AccordionItem>
<AccordionTrigger>What browsers are supported?</AccordionTrigger>
<AccordionContent>
<p>
Our website is optimized for the latest versions of Chrome, Firefox, Safari, and Edge.
Check our <a href="#" class="underline underline-offset-2 text-primary ">documentation</a> for more info.
</p>
</AccordionContent>
</AccordionItem>
<AccordionItem>
<AccordionTrigger>How can I contact customer support?</AccordionTrigger>
<AccordionContent>
<p>
Reach out to our support team via email at
<a href="#" class="underline underline-offset-2 text-primary ">support@example.com</a>
or call 1-800-123-4567.
</p>
</AccordionContent>
</AccordionItem>
<AccordionItem>
<AccordionTrigger>What is the refund policy?</AccordionTrigger>
<AccordionContent>
<p>
Please refer to our <a href="#" class="underline underline-offset-2 text-primary ">refund policy page</a> for details.
</p>
</AccordionContent>
</AccordionItem>
</RzAccordion>Type is set to AccordionType.Single, ensuring that only one section is open at a time.<RzAccordion Type="AccordionType.Single">
<AccordionItem>
<AccordionTrigger>What browsers are supported?</AccordionTrigger>
<AccordionContent>
<p>
Our website is optimized for the latest versions of Chrome, Firefox, Safari, and Edge.
Check our <a href="#" class="underline underline-offset-2 text-primary ">documentation</a> for more info.
</p>
</AccordionContent>
</AccordionItem>
<AccordionItem>
<AccordionTrigger>How can I contact customer support?</AccordionTrigger>
<AccordionContent>
<p>
Reach out to our support team via email at
<a href="#" class="underline underline-offset-2 text-primary ">support@example.com</a>
or call 1-800-123-4567.
</p>
</AccordionContent>
</AccordionItem>
<AccordionItem>
<AccordionTrigger>What is the refund policy?</AccordionTrigger>
<AccordionContent>
<p>
Please refer to our <a href="#" class="underline underline-offset-2 text-primary ">refund policy page</a> for details.
</p>
</AccordionContent>
</AccordionItem>
</RzAccordion>Property Description Type Default TypeAccordionType enum – Determines how accordion sections behave when opened.AccordionType.Multiple: Allows multiple sections to be expanded simultaneously.AccordionType.Single: Ensures only one section is open at a time; opening a new section closes any previously open one.AccordionTypeAccordionType.MultipleChildContentRenderFragment – The content of the RzAccordion, typically consisting of one or more AccordionItem components, each containing AccordionTrigger and AccordionContent components.RenderFragmentnullProperty Description Type Default TitleString – The title displayed in the clickable header of the accordion section. This is used as a fallback when AccordionTrigger is not defined.stringstring.EmptyCollapsedBoolean – Determines if the section is initially collapsed ( true) or expanded (false).booltrueAccordionTriggerRenderFragment – The content for the clickable header part of the accordion item. When provided, this takes precedence over the Title property.RenderFragment?nullAccordionContentRenderFragment – The content to be displayed inside the section when it is expanded. RenderFragment?nullrzAccordion Alpine x-data component.Method Parameters Description None—No public methods are documented; behavior is driven by markup and state attributes.