Accordions for Power Apps
An accordion is a stacked list of headings where clicking one reveals the text under it. Makers reach for it when a screen has to hold several short blocks of text, such as FAQ answers, help notes, settings or the steps of a procedure, without showing all of them at once. Each PowerLibs accordion is built on one gallery with the sections in its Items property. Most styles keep one section open at a time and close the others; the Flush Accordion lets several stay open. Accordion is free; every other style needs a paid plan.
Pick a variant
- AccordionFreeClassic, Modern
Stacked headings that each reveal one block of text, one open at a time
Settings: Item 1, Item 2 and so on, each with a Title box and a Content box; Add New Item; a delete icon per item
- Accordion PlusPaidClassic, Modern
Sections with an animated plus and minus icon and a highlight color on the open one
Settings: Active Color; Item 1, Item 2 and so on, each with a Title box and a Content box; Add New Item; a delete icon per item
- Accordion CardPaidClassic, Modern
The same list with every section inside its own card container
Settings: Item 1, Item 2 and so on, each with a Title box and a Content box; Add New Item; a delete icon per item
- Bordered AccordionPaidClassic
Bordered cards where the open one takes your brand color on its border, a stripe on the left and its title
Settings: Row 1, Row 2 and so on, each with a Title box and a Content box; Add row; a delete icon per row
- Steps AccordionPaidClassic
Onboarding and processes: numbered badges, with a green check on every finished step
Settings: Row 1, Row 2 and so on, each with a Title box, a Content box and a Mark as done switch; Add row; a delete icon per row
- Settings AccordionPaidClassic
A settings page: an icon in a tinted square, a title with a one-line subtitle and a chevron
Settings: Row 1, Row 2 and so on, each with a Title box, a Subtitle box, an icon dropdown and a Content box; Add row; a delete icon per row
- Flush AccordionPaidClassic
A classic FAQ with dividers only, where several rows can be open and two links expand or collapse all
Settings: Heading; Expand all / Collapse all links switch; Row 1, Row 2 and so on, each with a Title box and a Content box; Add row; a delete icon per row
| Component | Plan | YAML | What it is for | Settings you can change |
|---|---|---|---|---|
| Accordion | Free | Classic, Modern | Stacked headings that each reveal one block of text, one open at a time | Item 1, Item 2 and so on, each with a Title box and a Content box; Add New Item; a delete icon per item |
| Accordion Plus | Paid | Classic, Modern | Sections with an animated plus and minus icon and a highlight color on the open one | Active Color; Item 1, Item 2 and so on, each with a Title box and a Content box; Add New Item; a delete icon per item |
| Accordion Card | Paid | Classic, Modern | The same list with every section inside its own card container | Item 1, Item 2 and so on, each with a Title box and a Content box; Add New Item; a delete icon per item |
| Bordered Accordion | Paid | Classic | Bordered cards where the open one takes your brand color on its border, a stripe on the left and its title | Row 1, Row 2 and so on, each with a Title box and a Content box; Add row; a delete icon per row |
| Steps Accordion | Paid | Classic | Onboarding and processes: numbered badges, with a green check on every finished step | Row 1, Row 2 and so on, each with a Title box, a Content box and a Mark as done switch; Add row; a delete icon per row |
| Settings Accordion | Paid | Classic | A settings page: an icon in a tinted square, a title with a one-line subtitle and a chevron | Row 1, Row 2 and so on, each with a Title box, a Subtitle box, an icon dropdown and a Content box; Add row; a delete icon per row |
| Flush Accordion | Paid | Classic | A classic FAQ with dividers only, where several rows can be open and two links expand or collapse all | Heading; Expand all / Collapse all links switch; Row 1, Row 2 and so on, each with a Title box and a Content box; Add row; a delete icon per row |
Paid means any paid plan (which plan do I need?). Classic and Modern are the two Power Apps control sets you can pick from the Copy YAML button. Open the category in the library: Accordions.
To copy a variant into Power Apps Studio, follow Getting Started.
After you paste
Accordion, Accordion Card and Accordion Plus are each a gallery named galAccordion (in the Modern YAML galAccordionModern, galAccordionCardModern and galAccordionPlusModern). Its Items property holds a table with three columns: id, title and body. The button btnAccordion on every row (btnButtonCanvas in Modern) writes the clicked row's id into the context variable varOpenAccordionItemId, or blank when that row is already open, and the body label lblBody is visible only while its row's id matches.
The newer styles work the same way under their own names: galAccordionBordered with varOpenAccordionId, galAccordionSteps with varOpenStepId (its rows add a done column), and galAccordionSettings with varOpenSettingId (its rows add subtitle and rowIcon). The Flush Accordion pastes as the container conAccordionFlush with the gallery galAccordionFlush inside, and keeps the id of every open row in the collection colOpenAccordionRows instead of a variable. Names use your prefix settings, except colOpenAccordionRows. The snippets below use Accordion; swap in the names of your style.
Put this in the OnSelect property of any button on the same screen to open the second section from code. Blank() instead of a number closes every section:
UpdateContext({ varOpenAccordionItemId: 2 })
Put this in the Text property of a Label on the same screen to show which section is open. It has to be the same screen, because a context variable does not exist anywhere else:
If(
IsBlank(varOpenAccordionItemId),
"Nothing open",
LookUp(galAccordion.AllItems, id = varOpenAccordionItemId, title)
)
Put this in the Items property of galAccordion to feed the sections from a SharePoint list called FAQ that has a Title column and a multi-line Answer column. The three column names must stay id, title and body, because every control in the row reads them by name:
AddColumns(
FAQ,
id, ID,
title, Title,
body, Answer
)
Good to know
- Every section starts collapsed, and the variable is blank until someone clicks a heading. To start with a section open, put
UpdateContext({ varOpenAccordionItemId: 1 })in the screen's OnVisible property. In the Flush Accordion,Collect(colOpenAccordionRows, { id: 1 })opens a row from code andClear(colOpenAccordionRows)closes them all. - Double quotes and line breaks in your titles and content are safe: the generator doubles each quote and joins line breaks with
Char(10). - The accordion lands centered, at most 640 wide, with a Height of
Parent.Height - Self.Y, so it fills the screen or container below it. A long answer grows its row, because the body label has AutoHeight switched on, and the gallery scrolls without a visible scrollbar when open rows need more room. - Accordion and Accordion Card ignore the brand color from your settings. Their colors are a built-in grey and white set, and the light and dark toggle next to Copy YAML swaps it for a dark set before you copy. Accordion Plus takes its Active Color setting for the title and the icon of the open section. Bordered, Steps, Settings and Flush use your brand color for their accents, and every style follows the light and dark toggle.
- Accordion, Accordion Card and Accordion Plus offer Classic and Modern YAML; the newer styles are Classic only. The Modern version swaps the two labels for Text controls and the button for a modern Button named
btnButtonCanvas, and the gallery gets its Modern name. The arrow (the plus in Accordion Plus) stays an Image control in both. Swap the names in the snippets above if you copy the Modern version. - The arrow and the plus are animated SVG images. Each click stores a timestamp for its row in the collection
varColAnimationTriggersso the animation plays again; you never touch it. - Expand all in the Flush Accordion opens the ids 1 up to the number of rows you typed in Settings. With your own data in
galAccordionFlush, change the OnSelect oflblFlushExpandAlltoClearCollect(colOpenAccordionRows, ShowColumns(galAccordionFlush.AllItems, id)).
Related
Open the family in the library at Accordions. Related guides: Tabs and Cards.