# Carousel slider

## 👉 **The Tag** <a href="#the-tag" id="the-tag"></a>

Slides a collection of containers horizontally. The slider can have different animations, depending on the tag placed (see section below).

**📍 Where to add the tag:** A second-level container

![](/files/-MflwVsZqRxBIJfuJQnP)

## 🏷️ Animation Tags

Each tag is a different animation. In the tabs below you can discover all of them!

{% tabs %}
{% tab title="Default" %}

```
[container:slider:default]
```

![](/files/-MfmtcDaX5FCHhLViKky)
{% endtab %}

{% tab title="Crossfade" %}

```
[container:slider:crossfade]
```

![](/files/-MfmuICslTVjcPQaThcd)
{% endtab %}

{% tab title="Cube" %}

```
[container:slider:cube]
```

![](/files/-Mfmw5zRzLqWB1SX4yGq)
{% endtab %}

{% tab title="Pager" %}

```
[container:slider:pager]
```

![](/files/-MfmwCMDm14-BmN-jEAv)
{% endtab %}

{% tab title="Parallax" %}

```
[container:slider:parallax]
```

![](/files/-MfmwGuWkHDSYohxGA4W)
{% endtab %}

{% tab title="Rotate" %}

```
[container:slider:rotate]
```

![](/files/-MfmwLd1jTGF14XuY4Rj)
{% endtab %}

{% tab title="Zoom" %}

```
[container:slider:zoom]
```

![](/files/-MfmwQMtPAGd3YJ-OuQ8)
{% endtab %}

{% tab title="Horizontal" %}

```
[container:slider:horizontal]
```

![](/files/-MfmwVuomkxrfb7zSm0R)
{% endtab %}
{% endtabs %}

## 🏷️ Optional Tags

You can add as many of these tags as you want to the slider container.

{% tabs %}
{% tab title="Slider Indicator" %}

```
[slider-indicator:#FFFFFFFF]
```

```
[slider-indicator:<active_color>:<inactive_color>]
```

![](/files/-Mfmxc1PLw9Ruqd1v_x4)

Adds a dots indicator at the bottom of the slide container, with the specified color (use 8-digit HEX code - alpha included). \
\
You can also specify a color for the active item and another color for the inactive ones.

**📍 Where to add the tag:** on the same layer as the <mark style="color:red;">`[container:slider]`</mark> tag.\
\
For example \[slider-indicator:] needs to be:

\[slider-indicator:#FFFF0000:#FF00FF00]. \
For #FF0000 and #00FF00, we add FF at the beginning to set alpha at 1 (no transparency).

{% hint style="warning" %}
This tag is supported for all slider animations except for <mark style="color:red;">`[container:slider:horizontal]`</mark>.
{% endhint %}
{% endtab %}

{% tab title="Infinite slide" %}

```
[slider-infinite]
```

![](/files/-Mfmy5E-1V21iEGNM9oD)

After the last slide, the first slide will be shown, so user can swipe in one direction infinitely.

**📍 Where to add the tag:** on the same layer as the <mark style="color:red;">`[container:slider]`</mark> tag.
{% endtab %}

{% tab title="Automatic slide" %}

```
[slider-automatic:<time-in-seconds>]
```

Slider will move automatically **every x seconds**.

For example: 8 seconds <mark style="color:red;">`[slider-automatic:8]`</mark>

**📍 Where to add the tag:** on the same layer as the <mark style="color:red;">`[container:slider]`</mark> tag.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
You can also add the tags <mark style="color:red;">`[action:prev-slide]`</mark>and <mark style="color:red;">\[action:next-slide]</mark> to any design element (i.e. buttons) for easy navigation between slides.
{% endhint %}

## 🏷️ **How to add the tag** <a href="#how-to-add-the-tag" id="how-to-add-the-tag"></a>

1. Create a slide design with your slides lined up next to each other horizontally, with each "slide" in its separate container. If you want to connect your slider to a list of data from API, see **step 5**.

{% hint style="info" %}
Only the <mark style="color:red;">`[container:slider:horizontal]`</mark> (i.e. horizontal scroll) allows for slides that are smaller than the width of the screen. All other slide effects must have individual slides that stretches the full width of the screen.
{% endhint %}

![If your design has slides smaller than the width of the screen, use \[container:slider:horizontal\]. ](/files/-Mg5G4l_1pJTO7Ky-YKy)

2\. **Create a container around the slider design** that contains all of your slides and is the full width of the screen. Similar to how you set up overflow behaviour for Figma prototype.

![Container setup for slides the full width of the app screen.](/files/-Mg5Ggx3sQY0A2MSio1_)

![Container setup for slides smaller than the width of the app screen.](/files/-Mg5GpIWe3TlvF61xlFN)

3\. Paste the slide animation Tag of your choice to the layer name of this container.

![](/files/-Mg5HNR38KhSwLv7_61S)

4\. Import to Bravo & preview on Bravo Vision 🚀

5\. If you want to connect API data to your slider, you only need to create the first slide as a placeholder design.

![](/files/-Mg5I2RqnemftqYC5eLs)

6\. Then connect your list of data the same way you would with a vertical scrolling list ([tutorial here](/data-binding/display-data-in-your-app/data-biding-bind-data-to-ui-for-a-list-page.md)). However, you need to connect the data array to the **individual slide element**, rather than the slider container.

![Connect the list request to the "Container" property of the slide element highlighted in blue.](https://s3.eu-central-1.amazonaws.com/trengo/media/inline_image_72445_mBlRrkJzcKWYqSZRUmkc0UQZd7zAA8bkCNMETyLt_1652180692131.1652180692131.png)

7\. If you want each slide to open another page, make sure you link the individual slide element to the other page.

![](/files/-Mg5MZHAWWPjUPfKqaqK)

8\. Preview on Bravo Vision 🚀

{% hint style="danger" %}
You cannot use the \[flexo] tag in a slider, as all slides need to have the same fixed size.
{% endhint %}

## 💾 Example files <a href="#example-files" id="example-files"></a>

Duplicate the files below to see how to set it up!

{% embed url="<https://www.figma.com/community/file/982167580060315188>" %}

{% file src="/files/-Mg5PeS1hM5OzUeo4glv" %}
Bravo Sample - Horizontal Sliders.xd
{% endfile %}


---

# 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.bravostudio.app/bravo-tags/containers/container-horizontal-slider.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.
