Skip to main content

Accordion Container

Rocket 2.0

The Accordion Container component groups other components into collapsible sections, each with its own title. Use it to break a long settings page or form into parts the user can open one at a time.

Properties​

Property
Description
Expected Value
SectionsThe sections to show, as a list of objects with an id and a title. Keep each id the same over time, since the components dropped into a section stay with its id.Array
Open sectionsThe ids of the sections that are open. It updates as the user opens and closes sections.Array. Default: ["general"]
Allow several openLets the user keep several sections open at the same time. When off, opening a section closes the one that was open.On or off. Default: On

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On changeTriggers when the set of open sections changes.
On expandTriggers when a section opens.
On collapseTriggers when a section closes.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
ExpandOpens the section named by Section id or index (empty: all), or every section when it is empty.components.accordioncontainer1.expand("")
CollapseCloses the section named by Section id or index (empty: all), or every section when it is empty.components.accordioncontainer1.collapse("")
Open sectionOpens the section whose id matches Section id.components.accordioncontainer1.openSection("")
Collapse allCloses every section.components.accordioncontainer1.collapseAll()
Set visibilityShows the component when true, hides it when false.components.accordioncontainer1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.accordioncontainer1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.accordioncontainer1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
sectionsThe sections to show, as a list of objects with an id and a title. Keep each id the same over time, since the components dropped into a section stay with its id.{{components.accordioncontainer1.sections}}
openSectionsThe ids of the sections that are open. It updates as the user opens and closes sections.{{components.accordioncontainer1.openSections}}
allowMultipleLets the user keep several sections open at the same time. When off, opening a section closes the one that was open.{{components.accordioncontainer1.allowMultiple}}
isExpandedtrue when at least one section is open.{{components.accordioncontainer1.isExpanded}}
openIndexesPositions of the open sections, counting from 0.{{components.accordioncontainer1.openIndexes}}
isVisibleWhether the component is visible.{{components.accordioncontainer1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.accordioncontainer1.isLoading}}
isDisabledWhether the component is disabled.{{components.accordioncontainer1.isDisabled}}

Styles​

Style
Default
Section height160
Header text (legacy)—
Item title colorTheme: Primary text
Divider colorTheme: Default border
Chevron colorTheme: Placeholder text
BackgroundTheme: Surface 1
Border radius—
Padding12
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.