# Working with Flex components

With Analytics+, you can create stunning multi-element dashboards. When you work with Flex positioning, you only need to choose the direction (horizontal or vertical), and Analytics+ will automatically handle the alignment and positioning with consistent gap and fill options.

Let's look at the options available to customize Flex containers.

## 1. Fit and fill options for individual elements

When you combine multiple elements into a flex container, you can choose whether the element should have a fixed size and position or whether the element should fill the available canvas space.

The images below depict the difference between the Fixed and Fill resizing options.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FR6zrDvR195MXfPNHJiEl%2Fimage.png?alt=media&#x26;token=90eca80d-8575-4e0f-894e-602981918502" alt=""><figcaption><p>Fixed resizing</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FXgI77tj5p1Rb493UXFfw%2F2024-11-11_17h10_45.png?alt=media&#x26;token=ea9a1614-d19d-40ce-9075-6789128e6305" alt=""><figcaption><p>Fill resizing</p></figcaption></figure></div>

## 2. Container Flex configuration

Click on the Flex element to customize. The Flex configuration side pane has 2 tabs:

#### **2.1. Properties**

1. **Position**: The X and Y coordinates where the flex container should be placed.
2. **Size**: The height and width of the container.&#x20;

Note: You can also click and drag the container to re-position or drag the the corners/edges to resize.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FlX8y9oKMfOhH0xQGuv9x%2Fimage.png?alt=media&#x26;token=7669baf3-77f7-4504-a6c1-71039adffd9f" alt=""><figcaption><p>Container size and position</p></figcaption></figure>

#### **2.2. Layout:**

#### **1. Direction**

Arrange elements vertically or horizontally. New elements will also be inserted based on the direction chosen. For example, when arranging elements vertically, new containers are automatically added at the bottom. Similarly, if you arrange flex elements horizontally, new containers will be added to the left.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F5Z27UyzvdOi19xk2HCm7%2FUntitled%20Project.gif?alt=media&#x26;token=40020c3b-e3ce-4595-ace2-735ca9e855b7" alt=""><figcaption><p>Arrangement direction </p></figcaption></figure>

#### **2. Gap**

Space between each element in a flex container. The gap will be set horizontally or vertically depending on the direction in which elements are aligned.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FKAVZscNe0sdBXKR1EPom%2Fimage.png?alt=media&#x26;token=e602c303-0bdb-4d98-afff-ea66fd66c9a3" alt=""><figcaption><p>Gap between elements in a container</p></figcaption></figure>

By default, the gap width is set to fixed. Enable the toggle for Auto width - each element is evenly spaced in the container.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FIkIoTQxzcE5FNfDswhPt%2FUntitled%20Project.gif?alt=media&#x26;token=6e575507-8df3-4d7c-b5dd-c2dbc00ad7aa" alt=""><figcaption><p>Auto gap</p></figcaption></figure>

#### 3. Align

Set the vertical and horizontal positioning of elements within the flex container. Some sample alignments are shown below:

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FXYae69xNcmf0YH9fHbS9%2Fimage.png?alt=media&#x26;token=b6873304-866b-40a4-9689-6ce877a7c272" alt=""><figcaption><p>Top left</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FPTOr5EKufIma3KpoTwkU%2F2024-11-22_17h27_41.png?alt=media&#x26;token=bc6c0b37-c0ab-42b5-bb13-51b91f2b7707" alt=""><figcaption><p>Center-Center</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FdkwV9WZ6pa3ZcpHcuuC5%2F2024-11-22_17h45_52.png?alt=media&#x26;token=b8cde4c3-2044-424f-8706-501a779a78ee" alt=""><figcaption><p>Bottom right</p></figcaption></figure></div>

#### 4. Padding

Set the spacing between the flex container and the elements. You can set uniform padding with the **All** option or **Custom** padding for each side.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FWZniQNCJu3GoRoIFlJoc%2Fimage.png?alt=media&#x26;token=bd02c76c-ace7-4a08-ac32-1e1c4478782b" alt=""><figcaption><p>Container padding</p></figcaption></figure>
