# Collapse/expand tag in Content

{% hint style="info" %}
The availability of functionality depends on the license and may not be available in all deployments.
{% endhint %}

Below is an example of how it looks on the application form using the expand/collapse marker in the Content:

![Figure 1. Appearance of the Content on the application form with the Expand/Collapse marker](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/vWp0fxZlq7wuwNmgXAJP/32k_files/image2024-2-6_13-52-34.png)

When creating the Content, prepare an artifact of type HTML. Example code:

{% code title="Sample HTML" expandable="true" %}

```html
<style>
  div.togglewrapper { margin-right: 10px; }
</style>

<div>Value from the application form: <b style="color: red;">${GesTextField1}</b></div>

<div>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nibh augue, suscipit a, scelerisque sed,
  lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. Phasellus pharetra nulla ac diam.
  Quisque semper justo at risus. Donec venenatis, turpis vel hendrerit interdum, dui ligula ultricies purus,
  sed posuere libero dui id orci. Nam congue, pede vitae dapibus aliquet, elit magna vulputate arcu,
  vel tempus metus leo non est.
</div>

<div style="display:flex; align-items:center; justify-content:space-between;margin-top:10px;margin-bottom:10px;">
  <div>Lorem ipsum dolor sit amet</div>
  <div class="toggleWrapper">
    <div class="unfold">Expand</div>
    <div class="fold">Collapse</div>
    <div class="toggle-icon"></div>
  </div>
</div>

/more/

<div>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nibh augue, suscipit a, scelerisque sed,
  lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. Phasellus pharetra nulla ac diam.
  Quisque semper justo at risus. Donec venenatis, turpis vel hendrerit interdum, dui ligula ultricies purus,
  sed posuere libero dui id orci. Nam congue, pede vitae dapibus aliquet, elit magna vulputate arcu,
  vel tempus metus leo non est.
</div>
```

{% endcode %}

The expand/collapse control is handled by the fragment:

{% code title="Expanding element" %}

```html
<div class="toggleWrapper">
  <div class="unfold">Expand</div>
  <div class="fold">Collapse</div>
  <div class="toggle-icon"></div>
</div>
```

{% endcode %}

The /more/ marker is responsible for dividing the Content into a collapsed and expanded part — everything before /more/ is the content visible by default, and everything after /more/ is the expanded part.

Right alignment of the button depends on the styles defined inside the Content (in the example, the following style was used in the Content):

{% code title="Sample alignment style" %}

```html
<style>
  div.togglewrapper { margin-right: 10px; }
</style>

<div style="display:flex; align-items:center; justify-content:space-between;margin-top:10px;margin-bottom:10px;">
  ...
</div>
```

{% endcode %}

It is important to:

* place the button in the visible part of the Content;
* ensure the elements have the appropriate classes: toggleWrapper, unfold, fold, toggle-icon;
* preserve the button structure.

{% hint style="info" %}
Demo application: demoTextContent
{% endhint %}
