# Visibility Actions

## Goals

* Show a hidden element
* Hide a visible element
* Toggle the visibility of an element &#x20;

## Action Attributes&#x20;

{% hint style="danger" %}
UNDER SPECIFICATION. &#x20;
{% endhint %}

e.g. `sa-action-display-show` = ( *event name* )  &#x20;

|                            |                                   |                            |
| -------------------------- | --------------------------------- | -------------------------- |
| `sa-action-display-hide`   | Hide the item                     | Adds style=display: none;  |
| `sa-action-display-show`   | Show the item                     | Adds style=display: block; |
| `sa-action-display-toggle` | Toggles the item visibility state |                            |

{% hint style="warning" %}
Works by using the `display` style property. Do not use it on elements that are targeted by Webflow interactions which affect the `display` style property, as it will conflict. In that situation, wrapping your elements in a DIV and using the SA5 attributes on that DIV is generally the recommended approach.&#x20;
{% endhint %}

## Data

### `sa-action-display:mode` = ( *mode* )&#x20;

**Optional.** One of... &#x20;

* `display` ( default )&#x20;
* `visibility`&#x20;
* `opacity`&#x20;

### `sa-action-display:display` = ( *display mode* )&#x20;

**Optional.** Any valid [CSS display mode](https://developer.mozilla.org/en-US/docs/Web/CSS/display)...

* `block` ( default )&#x20;
* `flex`&#x20;
* `grid`&#x20;
* `inline-block`&#x20;
* *etc.*&#x20;

{% hint style="success" %}
Used with a mode of display.&#x20;

By default, displaying a hidden element sets the display to block.  You can override this behavior here, which will be used both by sa-action-display-show and sa-action-display-toggle.&#x20;
{% endhint %}

### sa-action-display:opacity = ( min opacity )

Optional. Defaults to 0% ( fully hidden )&#x20;

## Future

* Hide and show&#x20;
  * Display
  * Visibility&#x20;
  * Opacity
* Transitions like fade-in / fade-out ?&#x20;
* ~~Separate visibility?~~&#x20;
  * Or just rely on class adder&#x20;


---

# 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://attr.sygnal.com/overview/events/actions/visibility-actions.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.
