Skip to content

Accordion

Vertical accordion container managing a stack of collapsible ExpandablePanel sections with optional single-panel open constraint.

Overview

Vertical accordion container managing a stack of collapsible ExpandablePanel sections with optional single-panel open constraint. Provides extensive layout configuration and interaction capabilities.

Basic Usage

Accordion accordion = new Accordion();
accordion.singleOpen(true);
accordion.addPanel(new ExpandablePanel("General"));
  • ExpandablePanel: Collapsible panel container with header bar, toggle chevron, and smooth expansion/collapse height animation.

API

Accordion()

Constructs an empty Accordion container.

Accordion::addPanel(ExpandablePanel)

Appends an ExpandablePanel to this accordion.

Parameter Type Description
panel ExpandablePanel The expandable panel.

Returns Accordion: This instance for chaining..

Accordion::clearPanels()

Removes all panels from this accordion.

Returns Accordion: This instance for chaining..

Accordion::panels()

Returns an unmodifiable list of expandable panels hosted in this accordion.

Returns List: An unmodifiable list of expandable panels..

Accordion::removePanel(ExpandablePanel)

Removes an ExpandablePanel from this accordion.

Parameter Type Description
panel ExpandablePanel The expandable panel.

Returns Accordion: This instance for chaining..

Accordion::singleOpen()

Returns true if opening one panel automatically closes all other panels.

Returns boolean: True if single-open mode is active..

Accordion::singleOpen(boolean)

Sets whether only a single panel may be expanded simultaneously.

Parameter Type Description
singleOpen boolean Whether only one panel may remain open at a time.

Returns Accordion: This instance for chaining..