# How to collapse all widgets except one?

**URL:** <https://forums.unrealengine.com/t/how-to-collapse-all-widgets-except-one/448839>\
**Category:** UI\
**Tags:** unreal-engine, menu, UI, Widget, UE4, question\
**Created:** [May 13, 2019, 1:35am UTC](https://forums.unrealengine.com/t/how-to-collapse-all-widgets-except-one/448839 "2019-05-13T01:35:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b4f4e441](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b4f4e441](https://forums.unrealengine.com/u/anonymous_user_2b4f4e441)\
**Post date:** [May 13, 2019, 1:35am UTC](https://forums.unrealengine.com/t/how-to-collapse-all-widgets-except-one/448839/1 "2019-05-13T01:35:48Z")

</div>

Hi all,

I’m new to blueprints and have a question that’s probably super easy to answer, but I can’t for the life of me.

I’m making an accordion style menu that has a vertical scroll box containing a number of dynamically generated buttons. Each button is a blueprint widget made up of a button and a canvas panel (the canvas panel acts as an info box for the button being clicked).

When I click a button, its canvas panel is shown (set to visible).  
When I click it again, the canvas panel collapses.

My issue is: when I click on a button, I want all other button info canvas panels in the list to collapse so that only the canvas panel shown, belongs to the button that was clicked.

How does one go about doing this in blueprints?

W3 has a good example of what I currently have, but their info boxes remain open if you click on other buttons.

> **[How To Create an Accordion](https://www.w3schools.com/howto/howto_js_accordion.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

I haven’t been able to find any info on this for weeks now, so any help, direction or learning materials would be greatly appreciated.

Many thanks in advance,

---

<div class="post-metadata">

**Author:** ![murphybridget](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@murphybridget](https://forums.unrealengine.com/u/murphybridget)\
**Post date:** [January 24, 2024, 6:10am UTC](https://forums.unrealengine.com/t/how-to-collapse-all-widgets-except-one/448839/2 "2024-01-24T06:10:27Z")

</div>

Thank you for sharing. Good luck on your project.
