# Generative UI: Layout

> Arrange content with cards, grids, tabs, carousels and spacing.

Source: <https://everruns.com/docs/reference/generative-ui/layout/>

Arrange content with cards, grids, tabs, carousels and spacing.

[All categories](https://everruns.com/docs/reference/generative-ui/)[Layout](https://everruns.com/docs/reference/generative-ui/layout/)[Text](https://everruns.com/docs/reference/generative-ui/text/)[Inputs](https://everruns.com/docs/reference/generative-ui/inputs/)[Data](https://everruns.com/docs/reference/generative-ui/data/)[Dynamic values](https://everruns.com/docs/reference/generative-ui/dynamic-values/)[Media](https://everruns.com/docs/reference/generative-ui/media/)[Composites](https://everruns.com/docs/reference/generative-ui/composites/)[Feedback](https://everruns.com/docs/reference/generative-ui/feedback/)

Try the controls and expand **A2UI example** for source. Actions display their message and values locally; no account or agent run is needed. Use **Reset** to start again. External maps and media load only when you select their load button.

No examples match. Try another component name or category.

Layout

## Box, Column, Row

`Box``Column``Row`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-0",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Column",
        "gap": 3,
        "children": [
          "row",
          "box"
        ]
      },
      {
        "id": "row",
        "component": "Row",
        "justify": "spaceBetween",
        "children": [
          "l",
          "v"
        ]
      },
      {
        "id": "l",
        "component": "Caption",
        "text": "Monthly price"
      },
      {
        "id": "v",
        "component": "Text",
        "text": "$290/mo",
        "fontWeight": "medium"
      },
      {
        "id": "box",
        "component": "Box",
        "direction": "row",
        "gap": 2,
        "padding": 3,
        "border": true,
        "radius": "lg",
        "children": [
          "b1",
          "b2"
        ]
      },
      {
        "id": "b1",
        "component": "Text",
        "text": "Box with border and radius"
      },
      {
        "id": "b2",
        "component": "Badge",
        "label": "Beta",
        "color": "info"
      }
    ]
  }
}
```

Layout

## Grid and GridItem

`Grid``GridItem`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-1",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Grid",
        "columns": 3,
        "gap": 2,
        "children": [
          "a",
          "b",
          "c"
        ]
      },
      {
        "id": "a",
        "component": "GridItem",
        "span": 2,
        "padding": 3,
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "at"
        ]
      },
      {
        "id": "at",
        "component": "Text",
        "text": "span 2"
      },
      {
        "id": "b",
        "component": "GridItem",
        "padding": 3,
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "bt"
        ]
      },
      {
        "id": "bt",
        "component": "Text",
        "text": "1"
      },
      {
        "id": "c",
        "component": "GridItem",
        "span": 3,
        "padding": 3,
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "ct"
        ]
      },
      {
        "id": "ct",
        "component": "Text",
        "text": "span 3 fills the row"
      }
    ]
  }
}
```

Layout

## Card variants

`Card`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-2",
    "catalogId": "copilotkit/standard@1",
    "dataModel": {
      "on": true
    },
    "components": [
      {
        "id": "root",
        "component": "Column",
        "gap": 3,
        "children": [
          "c1",
          "c2",
          "c3"
        ]
      },
      {
        "id": "c1",
        "component": "Card",
        "children": [
          "t1",
          "s1",
          "k1"
        ]
      },
      {
        "id": "t1",
        "component": "Title",
        "text": "Default card (interactive panel)"
      },
      {
        "id": "s1",
        "component": "Caption",
        "text": "Boxed because it holds a control."
      },
      {
        "id": "k1",
        "component": "CheckBox",
        "label": "Enable notifications",
        "value": {
          "@path": "/on"
        }
      },
      {
        "id": "c2",
        "component": "Card",
        "variant": "section",
        "children": [
          "t2",
          "x2"
        ]
      },
      {
        "id": "t2",
        "component": "Title",
        "text": "variant \"section\": heading plus content, no box",
        "size": "lg"
      },
      {
        "id": "x2",
        "component": "Text",
        "text": "Informational content renders without a border."
      },
      {
        "id": "c3",
        "component": "Card",
        "variant": "elevated",
        "children": [
          "x3"
        ]
      },
      {
        "id": "x3",
        "component": "Text",
        "text": "variant \"elevated\""
      }
    ]
  }
}
```

Layout

## Flow and FlowItem

`Flow``FlowItem`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-3",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Flow",
        "columns": 4,
        "gap": 2,
        "children": [
          "f1",
          "f2",
          "f3",
          "f4",
          "f5"
        ]
      },
      {
        "id": "f1",
        "component": "FlowItem",
        "span": 2,
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "g1"
        ]
      },
      {
        "id": "g1",
        "component": "Text",
        "text": "span 2"
      },
      {
        "id": "f2",
        "component": "FlowItem",
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "g2"
        ]
      },
      {
        "id": "g2",
        "component": "Text",
        "text": "span 1"
      },
      {
        "id": "f3",
        "component": "FlowItem",
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "g3"
        ]
      },
      {
        "id": "g3",
        "component": "Text",
        "text": "span 1"
      },
      {
        "id": "f4",
        "component": "FlowItem",
        "span": 3,
        "aspectRatio": "3 / 1",
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "g4"
        ]
      },
      {
        "id": "g4",
        "component": "Text",
        "text": "span 3, aspect ratio 3 / 1"
      },
      {
        "id": "f5",
        "component": "FlowItem",
        "background": "surface-secondary",
        "radius": "md",
        "children": [
          "g5"
        ]
      },
      {
        "id": "g5",
        "component": "Text",
        "text": "span 1"
      }
    ]
  }
}
```

Layout

## Carousel and CarouselItem

`Carousel``CarouselItem`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-4",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Carousel",
        "visibleItems": 2,
        "gap": 3,
        "showArrows": true,
        "children": [
          "s1",
          "s2",
          "s3",
          "s4"
        ]
      },
      {
        "id": "s1",
        "component": "CarouselItem",
        "padding": 4,
        "background": "surface-secondary",
        "radius": "lg",
        "children": [
          "p1"
        ]
      },
      {
        "id": "p1",
        "component": "Text",
        "text": "Slide 1"
      },
      {
        "id": "s2",
        "component": "CarouselItem",
        "padding": 4,
        "background": "surface-secondary",
        "radius": "lg",
        "children": [
          "p2"
        ]
      },
      {
        "id": "p2",
        "component": "Text",
        "text": "Slide 2"
      },
      {
        "id": "s3",
        "component": "CarouselItem",
        "padding": 4,
        "background": "surface-secondary",
        "radius": "lg",
        "children": [
          "p3"
        ]
      },
      {
        "id": "p3",
        "component": "Text",
        "text": "Slide 3"
      },
      {
        "id": "s4",
        "component": "CarouselItem",
        "padding": 4,
        "background": "surface-secondary",
        "radius": "lg",
        "children": [
          "p4"
        ]
      },
      {
        "id": "p4",
        "component": "Text",
        "text": "Slide 4"
      }
    ]
  }
}
```

Layout

## Spacer and Divider

`Spacer``Divider`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-5",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Column",
        "children": [
          "a",
          "d",
          "b",
          "sp",
          "c",
          "vr"
        ]
      },
      {
        "id": "a",
        "component": "Text",
        "text": "Above the divider"
      },
      {
        "id": "d",
        "component": "Divider"
      },
      {
        "id": "b",
        "component": "Text",
        "text": "Below the divider, then a 24px Spacer"
      },
      {
        "id": "sp",
        "component": "Spacer",
        "minSize": 6
      },
      {
        "id": "c",
        "component": "Text",
        "text": "After the spacer"
      },
      {
        "id": "vr",
        "component": "Row",
        "gap": 3,
        "children": [
          "v1",
          "vd",
          "v2"
        ]
      },
      {
        "id": "v1",
        "component": "Text",
        "text": "Left"
      },
      {
        "id": "vd",
        "component": "Divider",
        "axis": "vertical"
      },
      {
        "id": "v2",
        "component": "Text",
        "text": "Right of a Divider with axis \"vertical\""
      }
    ]
  }
}
```

Layout

## Tabs

`Tabs`

A2UI example

Put this operation inside an `a2ui` Markdown fence. Try the controls above. Actions appear locally in the preview; in an editable chat they become messages.

```
{
  "version": "1.0",
  "createSurface": {
    "surfaceId": "example-6",
    "catalogId": "copilotkit/standard@1",
    "components": [
      {
        "id": "root",
        "component": "Tabs",
        "tabs": [
          {
            "title": "Overview",
            "child": "t1"
          },
          {
            "title": "Specs",
            "child": "t2"
          },
          {
            "title": "Reviews",
            "child": "t3"
          }
        ]
      },
      {
        "id": "t1",
        "component": "Text",
        "text": "The overview panel. Each tab names its panel by id."
      },
      {
        "id": "t2",
        "component": "List",
        "items": [
          {
            "label": "Weight",
            "value": "1.2 kg"
          },
          {
            "label": "Battery",
            "value": "18 h"
          }
        ]
      },
      {
        "id": "t3",
        "component": "Text",
        "text": "4.6 out of 5 from 1,284 reviews."
      }
    ]
  }
}
```

Using these components in chat? See [Generative UI in chat](https://everruns.com/docs/features/generative-ui/) and [AG-UI support](https://everruns.com/docs/integrations/ag-ui/).

Examples adapted from the [CopilotKit standard catalog](https://docs.copilotkit.ai/generative-ui/components/standard-catalog), under the [MIT license](https://github.com/everruns/everruns/blob/main/apps/ui/generative-ui/COPILOTKIT-LICENSE).