# How to collapse content in edit mode?

**URL:** <https://forums.realmacsoftware.com/t/how-to-collapse-content-in-edit-mode/45984>\
**Category:** Elements API\
**Created:** [January 19, 2025, 7:06am UTC](https://forums.realmacsoftware.com/t/how-to-collapse-content-in-edit-mode/45984 "2025-01-19T07:06:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bartje](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bartje/32/1210_2.png) [@Bartje](https://forums.realmacsoftware.com/u/Bartje)\
**Post date:** [January 19, 2025, 7:06am UTC](https://forums.realmacsoftware.com/t/how-to-collapse-content-in-edit-mode/45984/1 "2025-01-19T07:06:10Z")

</div>

I’ve created a custom component whose content can take up a lot of space. Is there a possibility to collapse the content in edit mode (via a property), so there’s more space for page development?

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [January 19, 2025, 12:23pm UTC](https://forums.realmacsoftware.com/t/how-to-collapse-content-in-edit-mode/45984/2 "2025-01-19T12:23:02Z")

</div>

You could put in an if statement (toggle control) in your custom component that hides and shows the content?

```auto
@if(switch)
    <li><b>This is only visible when switch is true</b></li>
@endif

```

Check out [Conditional statements in the Docs](https://docs.realmacsoftware.com/elements-docs/elements-language/bundle-structure/components/templates/conditional-statements), and the [Switch UI control](https://docs.realmacsoftware.com/elements-docs/elements-language/bundle-structure/components/properties.json/ui-controls/switch).

Let me know if you need any more help!

---

<div class="post-metadata">

**Author:** ![Bartje](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bartje/32/1210_2.png) [@Bartje](https://forums.realmacsoftware.com/u/Bartje)\
**Post date:** [January 19, 2025, 3:35pm UTC](https://forums.realmacsoftware.com/t/how-to-collapse-content-in-edit-mode/45984/3 "2025-01-19T15:35:45Z")

</div>

@dan: That’s exactly what I was looking for. 🙏

I have another question: in some custom components, I can only see the result in preview mode and not in edit mode. Is there a solution to make the components visible in edit mode as well, and not just in preview mode?

---

<div class="post-metadata">

**Author:** ![PeteSharp](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/petesharp/32/31752_2.png) [@PeteSharp](https://forums.realmacsoftware.com/u/PeteSharp)\
**Post date:** [March 21, 2025, 5:30am UTC](https://forums.realmacsoftware.com/t/how-to-collapse-content-in-edit-mode/45984/4 "2025-03-21T05:30:01Z")

</div>

Thanks, exactly what I was looking for 😃
