# Collapsible Area Action

{% hint style="info" %}
**Block Information**

Available in: Page Flow

Toolbox Category: Action

Block Type: [Regular](/app-editor/page-flow/block-anatomy.md#regular-block)
{% endhint %}

**`Collapsible Area Action`** is a [regular block](/app-editor/page-flow/block-anatomy.md#regular-block) that allows you trigger the expansion or collapse of a [Collapsible Area](/app-editor/page-editor/built-in-elements/collapsible-area.md) element on the page or form.

{% hint style="success" %}
Refer to the [Collapsible Area Action in Data Design](/app-editor/page-flow/toolbox-blocks/collapsible-area-action-in-data-design.md) block for dynamically generated content.
{% endhint %}

The block comes in two modes which are discussed below.

## Mode 1 <a href="#mode-1" id="mode-1"></a>

<div align="left"><figure><img src="/files/2LPam5ERl8Z2c6ZZFDL8" alt="" width="372"><figcaption><p>Collapsible Area Action (Mode 1)</p></figcaption></figure></div>

The Mode 1 version of the Collapsible Area Action block consists of (from left to right):

* *Action*: [Dropdown configuration setting](/app-editor/page-flow/block-anatomy.md#dropdown) that allows you to choose from three options:
  1. Expand: Expands the element.
  2. Collapse: Collapses the element.
  3. Toggle: Toggles the state of the element i.e. collapses it if it is expanded and vice-versa.
* *Element*: [Selectable Input](/app-editor/page-flow/block-anatomy.md#selectable-input) to choose the [Collapsible Area](/app-editor/page-editor/built-in-elements/collapsible-area.md) element.

## Mode 2 <a href="#mode-2" id="mode-2"></a>

<div align="left"><figure><img src="/files/yG8tNCSQPX5A6bgf7cIs" alt="" width="341"><figcaption><p>Collapsible Area Action (Mode 2)</p></figcaption></figure></div>

The Mode 2 version of the Collapsible Area Action block consists of (from left to right):

* *Action*: [Dropdown configuration setting](/app-editor/page-flow/block-anatomy.md#dropdown) that allows you to choose from three options:
  1. Expand: Expands the element.
  2. Collapse: Collapses the element.
  3. Toggle: Toggles the state of the element i.e. collapses it if it is expanded and vice-versa.
* *Element*: [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts either a [*text*](/app-editor/page-flow/references/value-types.md) value in the form of a [CSS Selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) or an [*element*](/app-editor/page-flow/references/value-types.md) value[.](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) The Element block comes pre-attached for your convenience but can be removed and customized.

***

## Usage Examples

The image below shows an example of the Mode 1 version where the selected [Collapsible Area](/app-editor/page-editor/built-in-elements/collapsible-area.md) element is expanded.

<div align="left"><figure><img src="/files/FZ7W4IA54lhqTOGszQmV" alt="" width="563"><figcaption><p>Example of Collapsible Area Action (Mode 1)</p></figcaption></figure></div>

In the next example we see a Mode 2 version where the *Element* value parameter is attached to a Text block containing a [CSS Selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors) that selects the same element. This time the element's state is toggled.

<div align="left"><figure><img src="/files/88GdsiWBlZWOApA0KLru" alt="" width="563"><figcaption><p>Example of Collapsible Area Action (Mode 2)</p></figcaption></figure></div>

{% hint style="success" %}
NOTE: Using a CSS selector, you can operate on multiple elements that match the criteria specified by the selector. See the references below for more information:

* [Wikipedia article on CSS](https://en.wikipedia.org/wiki/CSS#Selector)
* [Mozilla Developer Network article on CSS selectors](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors)
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/collapsible-area-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
