Skip to main content

Accordion

Rocket 2.0

The Accordion component shows a list of sections with a title each, where the user opens a section to read its text. Use it for FAQs, help text or details that should stay out of the way until needed.

Properties​

Property
Description
Expected Value
ItemsThe sections to show, as a list of objects with a title and content. Add a value to name a section for Open item (value) and the Open item action.Array
Several open at onceLets 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: Off
Open by default (indexes)Positions of the sections that start open, counting from 0, such as [0] for the first section.Array
Open item (value)Opens the section whose value matches. It also updates to the value of the first open section as the user opens and closes them.Text
Loading lookWhat shows while the component is loading: a Spinner or a grey Skeleton block.Spinner, Skeleton. Default: Spinner

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
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.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 at Index (empty: all), or every section when the index is empty. With Several open at once off, it opens one section only.components.accordion1.expand("")
CollapseCloses the section at Index (empty: all), or every section when the index is empty.components.accordion1.collapse("")
Open itemOpens the section whose value matches Item value.components.accordion1.open("")
Collapse allCloses every section.components.accordion1.collapseAll()
Set visibilityShows the component when true, hides it when false.components.accordion1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.accordion1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.accordion1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
itemsThe sections to show, as a list of objects with a title and content. Add a value to name a section for Open item (value) and the Open item action.{{components.accordion1.items}}
multipleLets the user keep several sections open at the same time. When off, opening a section closes the one that was open.{{components.accordion1.multiple}}
defaultOpenPositions of the sections that start open, counting from 0, such as [0] for the first section.{{components.accordion1.defaultOpen}}
valueOpens the section whose value matches. It also updates to the value of the first open section as the user opens and closes them.{{components.accordion1.value}}
loadingIndicatorWhat shows while the component is loading: a Spinner or a grey Skeleton block.{{components.accordion1.loadingIndicator}}
openIndexesPositions of the open sections, counting from 0.{{components.accordion1.openIndexes}}
isExpandedtrue when at least one section is open.{{components.accordion1.isExpanded}}
isVisibleWhether the component is visible.{{components.accordion1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.accordion1.isLoading}}
isDisabledWhether the component is disabled.{{components.accordion1.isDisabled}}

Styles​

Style
Default
Item title colorTheme: Primary text
Item content colorTheme: Placeholder text
Divider colorTheme: Default border
Chevron colorTheme: Placeholder text
Divider (legacy)—
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.