Accordion Card
The Accordion Card is a card with a header that the operator clicks to expand or collapse it. When it is expanded, it shows an embedded view below the header. Use it to keep a group of details out of the way until the operator needs them. It is found in the Embedding - OpenBridge section of the Perspective Component Palette as Accordion Card.

The parts of the card:
- Header — the title, and optionally an icon, a description and a status label. See Header.
- Chevron — points down when the card is collapsed and up when it is expanded. See Expanding and Collapsing.
- Content — the view shown when the card is expanded. See Embedded View.
An Accordion Card dropped from the palette is collapsed, has the title
Accordion Card and no view:

Embedded View
Section titled “Embedded View”The content of the card is another view, not components dropped onto the card:
the Accordion Card is not a container. Set viewPath to the view to show, and
viewParams to the parameters passed to it. The names in viewParams must
match the parameters of that view. Design the content as an ordinary view, for
example a Flex Container with the readouts that belong to the card.

With viewPath empty, the expanded card shows only an empty area under the
header.
Note: The screenshots on this page show stand-in content, not a view loaded from a gateway.
The card is as wide as its box (the blue frame). Its height is the height of the header, plus the height of the view when it is expanded. The box does not change size when the card expands or collapses:
| Collapsed, in a 320 × 48 box | ![]() |
| Expanded, in a box tall enough | ![]() |
| Expanded, in the box of a new card (50 px) | ![]() |
When the card expands in a box sized for the header, the card grows out of the
box and is drawn over whatever lies below it: a component cannot resize its own
box. The way to use it is in a Flex Container with the card’s position.basis
set to auto, so the box follows the card’s height and the components below
move down. Otherwise, make the box tall enough for the expanded card, or bind
the height of the box to expanded.
Properties
Section titled “Properties”| Name | Description | Property Type |
|---|---|---|
| viewPath | The view shown when the card is expanded. Default empty. | value |
| viewParams | Parameters passed to the view. The names must match the parameters of the view. Default {}. |
object |
Expanding and Collapsing
Section titled “Expanding and Collapsing”A click anywhere on the header toggles the card. The card writes the new state
to expanded and fires onActionPerformed. Set or bind expanded to open or
close the card from elsewhere.
The content slides open and closed, and the chevron turns with it. When the operator’s system is set to reduce motion, the card switches without the animation.
| Collapsed | ![]() |
| Expanded | ![]() |
disabled greys the card out and ignores clicks on it: expanded is not
changed and no event is fired. A disabled card keeps its state, so a card that
is disabled while expanded stays expanded.

Note: A click writes
expanded. In the Designer, a click in Preview Mode changes the property, and the change is saved with the view.
Properties
Section titled “Properties”| Name | Description | Property Type |
|---|---|---|
| expanded | Whether the card is expanded. Written by the card when the operator clicks it. Default false. |
value |
| disabled | Grey the card out and ignore clicks. Default false. |
value |
Header
Section titled “Header”The header always shows cardTitle. Three optional parts are each turned on
with a has… property:
| Part | |
|---|---|
| Leading icon | |
| Status label | ![]() |
The description is shown only when size is large. size selects the height
of the header:
| size | |
|---|---|
single-line (default) |
![]() |
large |
![]() |
Properties
Section titled “Properties”| Name | Description | Property Type |
|---|---|---|
| cardTitle | The title. Default Accordion Card. |
value |
| size | Height of the header: single-line or large. Default single-line. |
value |
| hasDescription | Show a description under the title. Only drawn when size is large. Default false. |
value |
| description | Text of the description. Only shown when hasDescription is true. |
value |
| hasStatusLabel | Show a status label at the right of the header. Default false. |
value |
| statusLabel | Text of the status label, for example Normal. Only shown when hasStatusLabel is true. |
value |
| hasLeadingIcon | Show an icon before the title. Default false. |
value |
| leadingIcon | The icon, chosen with the icon picker (leadingIcon.path). Only shown when hasLeadingIcon is true. |
object |
Stacking Cards
Section titled “Stacking Cards”To build a list of cards that look like one surface, stack Accordion Cards
without a gap and set position on each: top for the first card, center
for the cards in the middle and bottom for the last. position only changes
which corners are rounded:
regular(default) — all corners rounded: a card on its own.top— the bottom corners are square.center— all corners are square.bottom— the top corners are square.
top, center, bottom |
![]() |
regular, with a gap |
![]() |
Each card expands on its own; expanding one does not collapse the others. To keep only one card open, see Example 2.
Properties
Section titled “Properties”| Name | Description | Property Type |
|---|---|---|
| position | Corner rounding: regular, top, center or bottom. Default regular. |
value |
Properties
Section titled “Properties”Properties not covered in the sections above:
| Name | Description | Property Type |
|---|---|---|
| style | Standard Perspective style object. | object |
Component Events
Section titled “Component Events”| Event | Description | Event Object |
|---|---|---|
| onActionPerformed | Fired when the operator expands or collapses the card, after expanded is written. Not fired when the card is disabled, nor when expanded is changed by a binding or a script. |
— |
To act on the new state, read self.props.expanded in the event script.
Examples
Section titled “Examples”Example 1 — Fuel Details per Tank Group
Section titled “Example 1 — Fuel Details per Tank Group”- Create a view
Fuel/Overviewwith a parametergroup, and place the readouts for the tanks in that group in it. - Drop an Accordion Card into a Flex Container (direction column). Set
cardTitletoFuel,viewPathtoFuel/OverviewandviewParamsto{"group": "day"}. - Bind
position.basisof the card toexpanded, with a transform that returns"148px"when it istrueand"48px"otherwise (adjust to the height of your view), so the components below move when the card expands.
Example 2 — Only One Card Open
Section titled “Example 2 — Only One Card Open”-
Stack three Accordion Cards in a Flex Container (direction column, no gap) and set
positiontotop,centerandbottom. -
Add a custom property
openCardto the view (view.custom.openCard). -
On each card, bind
expandedto an expression that compares it with the card’s own name, for example{view.custom.openCard} = "fuel"on the Fuel card. -
On each card’s
onActionPerformed, add a script that writes the card’s name when the card was expanded, and clears it when it was collapsed:self.view.custom.openCard = "fuel" if self.props.expanded else ""Opening a card then closes the card that was open.
Found an error or something unclear?
Tell us what is wrong, confusing or missing on this page.
Built on the OpenBridge Design System







