> For the complete documentation index, see [llms.txt](https://docs.uibakery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uibakery.io/reference/working-with-components/flex-container.md).

# Flex Container

## Overview

A flex container is used as a container for a set of different components. The component utilizes [CSS Flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox) to manage the layout of child elements. Flexbox provides advanced layout capabilities that are crucial for handling dynamic content and ensuring layouts adapt appropriately across different screen sizes.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FIJvzFQ9dHRZ4JHAEEnon%2FCleanShot%202025-07-29%20at%2015.56.17%402x-min.png?alt=media&amp;token=11b9705d-b4bb-4088-80ca-72bd740e1348" alt=""><figcaption></figcaption></figure>

### Properties

<table><thead><tr><th width="132.37890625">Name</th><th width="135.2109375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code></td><td>Component name</td></tr><tr><td><code>value</code></td><td><code>value</code></td><td>Current component value</td></tr><tr><td><code>children</code></td><td><code>children</code></td><td>The children of the card</td></tr><tr><td><code>valid</code></td><td><code>boolean</code></td><td>Indicates if the card is valid</td></tr></tbody></table>

### Methods

<table><thead><tr><th width="161.34765625">Name</th><th width="131.62109375">Parameters</th><th width="103.47265625">Returns</th><th>Description</th></tr></thead><tbody><tr><td><code>setValue</code></td><td><code>data: object</code></td><td><code>void</code></td><td>Set component data</td></tr><tr><td><code>resetValue</code></td><td>–</td><td><code>void</code></td><td>Reset component to the initial value</td></tr><tr><td><code>validate</code></td><td>–</td><td><code>void</code></td><td>Trigger form validation</td></tr><tr><td><code>resetValidation</code></td><td>–</td><td><code>void</code></td><td>Clear validation errors</td></tr></tbody></table>

### Triggers

<table><thead><tr><th width="145.26171875">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>On Init</strong></td><td>Triggered when the component is initialized</td></tr></tbody></table>

## Working with the component

The Flex Container allows you to:

* Define the *width* and *height* of child components inside the container. The following options are available: pixels, percent, and auto.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2Fb9VVvcBcwvMxfzcBg0xw%2FCleanShot%202025-07-29%20at%2016.12.14%402x-min.png?alt=media&amp;token=83f4f603-c1fc-4523-abca-47216283aa2f" alt=""><figcaption></figcaption></figure>

It's also possible to configure 100% height of components inside the Flex Container. See this article for more details:point\_down:

{% content-ref url="/pages/o7QivJLziEfH8MWlGja7" %}
[100% height components](/how-tos/components-recipes/100-height-components.md)
{% endcontent-ref %}

* Configure one child component to *occupy all free space* on one side - the other component has a set width. In this case, you can use the child component's *Grow* property and set it to *1*.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FLproL80O5vAxEFxj36cL%2Fimage%20(2)%20(1).png?alt=media&amp;token=6bbfbc69-764a-4d15-b3f1-7a16c1038d8d" alt=""><figcaption></figcaption></figure>

* Configure *content and items alignment* inside the container using the *Flex justify/align* settings.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FxGg6hi2mxbZuwtgHk8Ca%2Fimage%20(1).png?alt=media&amp;token=ce06f91d-e2ef-453b-ab16-bb3b345a091e" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uibakery.io/reference/working-with-components/flex-container.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
