> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/sdk-dv-ui/layout/container.md). Agents can also search and read this documentation through its [MCP server](https://docs.rierino.com/~gitbook/mcp).

# Container, Row and Column

Group components, side by side or one under another.

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

```json
{
  "sources": [],
  "layout": {
    "type": "RRow",
    "items": [
      {
        "type": "RCol",
        "items": [
          {
            "type": "RLabel",
            "props": {
              "label": "A",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          },
          {
            "type": "RLabel",
            "props": {
              "label": "B",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          }
        ]
      },
      {
        "type": "RCol",
        "items": [
          {
            "type": "RLabel",
            "props": {
              "label": "C",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          },
          {
            "type": "RLabel",
            "props": {
              "label": "D",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          },
          {
            "type": "RLabel",
            "props": {
              "label": "E",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          }
        ]
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Usage

Put the components to group in `items`:

```json
{
  "type": "RRow",
  "items": [
    { "type": "RIconStat", "props": { "title": "Revenue" } },
    { "type": "RIconStat", "props": { "title": "Orders" } }
  ]
}
```

* **Row** (`RRow`) places its items side by side and shares the width between them equally.
* **Column** (`RCol`) places its items one under another, each taking the full width.
* **Container** (`RContainer`) groups items without arranging them, and keeps them to a readable width in the middle of wide screens. Use it as the outer component of a full-page dashboard.

A layout component with a single child can use `item` instead of `items`.

## Examples

### Row

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

```json
{
  "sources": [],
  "layout": {
    "type": "RRow",
    "items": [
      {
        "type": "RLabel",
        "props": {
          "label": "A",
          "classes": {
            "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
            "sublabel": "hidden"
          }
        }
      },
      {
        "type": "RLabel",
        "props": {
          "label": "B",
          "classes": {
            "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
            "sublabel": "hidden"
          }
        }
      },
      {
        "type": "RLabel",
        "props": {
          "label": "C",
          "classes": {
            "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
            "sublabel": "hidden"
          }
        }
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### Column

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

```json
{
  "sources": [],
  "layout": {
    "type": "RCol",
    "items": [
      {
        "type": "RLabel",
        "props": {
          "label": "A",
          "classes": {
            "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
            "sublabel": "hidden"
          }
        }
      },
      {
        "type": "RLabel",
        "props": {
          "label": "B",
          "classes": {
            "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
            "sublabel": "hidden"
          }
        }
      },
      {
        "type": "RLabel",
        "props": {
          "label": "C",
          "classes": {
            "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
            "sublabel": "hidden"
          }
        }
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### Rows and columns together

Nest them for layouts that a single grid can't express, such as columns with different numbers of items:

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

```json
{
  "sources": [],
  "layout": {
    "type": "RRow",
    "items": [
      {
        "type": "RCol",
        "items": [
          {
            "type": "RLabel",
            "props": {
              "label": "A",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          },
          {
            "type": "RLabel",
            "props": {
              "label": "B",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          }
        ]
      },
      {
        "type": "RCol",
        "items": [
          {
            "type": "RLabel",
            "props": {
              "label": "C",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          },
          {
            "type": "RLabel",
            "props": {
              "label": "D",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          },
          {
            "type": "RLabel",
            "props": {
              "label": "E",
              "classes": {
                "root": "flex items-center justify-center h-16 rounded-lg border border-solid border-hawkes-blue bg-titan-white",
                "sublabel": "hidden"
              }
            }
          }
        ]
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

For items aligned in both directions, a [Grid](https://docs.rierino.com/sdk-dv-ui/layout/grid.md) is simpler.

## Props

| Prop      | Type     | Default | Description                                               |
| --------- | -------- | ------- | --------------------------------------------------------- |
| `classes` | `object` |         | Class names for the component's parts, see Classes below. |

In the Rierino designer, all three have only **Classes**.

## Classes

Each part takes its classes from the built-in template. Set `classes.<part>` to replace them, or `classes.<part>Extra` to add to them.

| Component | Part   | Built-in classes                                          |
| --------- | ------ | --------------------------------------------------------- |
| Container | `root` | `container mx-auto`                                       |
| Row       | `root` | `flex flex-row space-x-2 [&>*]:grow [&>*]:shrink`         |
| Column    | `root` | `flex flex-col space-y-2 [&>*]:grow [&>*]:shrink gap-y-2` |

For example, to keep a row's items at their own width and push them apart:

```json
{
  "type": "RRow",
  "props": { "classes": { "root": "flex flex-row justify-between" } },
  "items": []
}
```


---

# 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.rierino.com/sdk-dv-ui/layout/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.
