> ## Documentation Index
> Fetch the complete documentation index at: https://prefab.prefect.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Row

> Horizontal flex container for arranging children side-by-side.

Row arranges children horizontally with flexbox. Use `gap` to control spacing between items.

## Basic Usage

> [card]
>
> ```python Python icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> from prefab_ui.components import (
>     Div,
>     Row,
> )
>
> with Row(gap=4):
>     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
>     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
>     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> ```
>
> ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> {
>   "view": {
>     "cssClass": "gap-4",
>     "type": "Row",
>     "children": [
>       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
>       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
>       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
>     ]
>   }
> }
> ```

## Gap

Gap controls the spacing between children. Larger values give more visual separation.

> [tab] gap=4
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=4, css_class="p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-4 p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] gap=8
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=8, css_class="p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-8 p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] gap=12
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=12, css_class="p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-12 p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

## Alignment

`align` controls vertical alignment of children. The difference is visible when children have different heights.

> [tab] align="start"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=4, align="start", css_class="p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-8 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-16 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-4 items-start p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-8 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-16 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] align="center"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=4, align="center", css_class="p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-8 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-16 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-4 items-center p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-8 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-16 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] align="end"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=4, align="end", css_class="p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-8 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-16 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-4 items-end p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-8 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-16 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] align="baseline"
>
> Baseline aligns children along the invisible line that text sits on. Unlike `center`, which vertically centers boxes, `baseline` makes text of different sizes read naturally — as if on the same line of a page.
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Row, Span
> >
> > with Row(gap=4, align="baseline", css_class="p-3 border-3 border-dashed"):
> >     Span(
> >         "Small",
> >         css_class="bg-emerald-500 rounded-md "
> >         "px-3 py-1 text-white text-sm",
> >     )
> >     Span(
> >         "Large",
> >         css_class="bg-emerald-500 rounded-md "
> >         "px-3 py-2 text-white text-2xl",
> >     )
> >     Span(
> >         "Medium",
> >         css_class="bg-emerald-500 rounded-md "
> >         "px-3 py-1 text-white text-base",
> >     )
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-4 items-baseline p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {
> >         "cssClass": "bg-emerald-500 rounded-md px-3 py-1 text-white text-sm",
> >         "content": "Small",
> >         "code": false,
> >         "type": "Span"
> >       },
> >       {
> >         "cssClass": "bg-emerald-500 rounded-md px-3 py-2 text-white text-2xl",
> >         "content": "Large",
> >         "code": false,
> >         "type": "Span"
> >       },
> >       {
> >         "cssClass": "bg-emerald-500 rounded-md px-3 py-1 text-white text-base",
> >         "content": "Medium",
> >         "code": false,
> >         "type": "Span"
> >       }
> >     ]
> >   }
> > }
> > ```

## Justification

`justify` controls how children are distributed along the horizontal axis.

> [tab] justify="start"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=1, justify="start", css_class="w-full p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-1 justify-start w-full p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] justify="center"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=1, justify="center", css_class="w-full p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-1 justify-center w-full p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] justify="end"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=1, justify="end", css_class="w-full p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-1 justify-end w-full p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] justify="between"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=1, justify="between", css_class="w-full p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-1 justify-between w-full p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] justify="around"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=1, justify="around", css_class="w-full p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-1 justify-around w-full p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

> [tab] justify="evenly"
>
> > [card]
> >
> > ```python Python highlight={3} icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > from prefab_ui.components import Div, Row
> >
> > with Row(gap=1, justify="evenly", css_class="w-full p-3 border-3 border-dashed"):
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> >     Div(css_class="bg-emerald-500 rounded-md h-10 w-20")
> > ```
> >
> > ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> > {
> >   "view": {
> >     "cssClass": "gap-1 justify-evenly w-full p-3 border-3 border-dashed",
> >     "type": "Row",
> >     "children": [
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"},
> >       {"cssClass": "bg-emerald-500 rounded-md h-10 w-20", "type": "Div"}
> >     ]
> >   }
> > }
> > ```

## API Reference

> [card] Row Parameters
>
> **gap** `int | tuple | Responsive | None` (default: None)
>
> Gap between children. An int maps to `gap-{n}`. A tuple `(x, y)` sets per-axis gaps; use `None` to skip an axis. A `Responsive()` sets different gaps at different breakpoints.
>
> **align** `str | None` (default: None)
>
> Cross-axis alignment: `"start"`, `"center"`, `"end"`, `"stretch"`, `"baseline"`.
>
> **justify** `str | None` (default: None)
>
> Main-axis distribution: `"start"`, `"center"`, `"end"`, `"between"`, `"around"`, `"evenly"`, `"stretch"`.
>
> **css\_class** `str | Responsive | None` (default: None)
>
> Additional Tailwind CSS classes. A `Responsive()` compiles breakpoint-prefixed classes.

## Protocol Reference

```json Row theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "type": "Row",
  "id?": "string",
  "onMount?": "any",
  "children?": "[Component]",
  "let?": "object",
  "gap?": "number | [number, number]",
  "align?": "start | center | end | stretch | baseline",
  "justify?": "start | center | end | between | around | evenly | stretch",
  "cssClass?": "string"
}
```

For the complete protocol schema, see [Row](https://prefab.prefect.io/docs/protocol/row.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.