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

> ## Agent Instructions
> To set up Hatchmark for a user, follow https://hatchmark.dev/docs/get-started/agent-setup.md. Inside a Hatchmark project, prefer `hatchmark docs`: it prints the docs of the installed version.

# Group

> Lays out blocks together in one grid cell, in a row or a column, in one card or as separate cards. Use it for a rail of KPIs beside a map, or a headline card.

```yaml theme={null}
- type: map
  geo: world-countries
  region: issuer_country
  value: payment_volume
  span: 9
- type: group
  span: 3
  direction: column
  blocks:
    - { type: kpi, metric: payment_volume, sparkline: true }
    - { type: kpi, metric: auth_rate, sparkline: true }
    - { type: kpi, metric: chargeback_rate, target: network_limit }
    - { type: kpi, metric: payments }
```

[Live preview of the layout component](https://components.hatchmark.dev/components/layout/?embed\&theme=light)

The preview above is the live component gallery. [Open it full size](https://components.hatchmark.dev/#/layout) to switch between desktop and phone widths.

## Options

| Field | Type | Default | Description |
| - | - | - | - |
| `blocks` | 2 or more blocks | required | Any block, but no `table` in a column, and no group three levels deep. |
| `direction` | `row`, `column` | `row` | Side by side, or stacked. |
| `card` | boolean | `true` | One card divided by hairlines, or each block in its own card. |
| `span` | 1–12 | `12` | Width in the 12-column grid. |
| `title` | string | none | Card title, when `card` is true. |

## Examples

### A headline card

A group inside a group lays out one level further: one large KPI with a row of four under it.

```yaml theme={null}
- type: group
  span: 7
  direction: column
  blocks:
    - { type: kpi, metric: arr, height: tall, target: year_end }
    - type: group
      direction: row
      blocks:
        - { type: kpi, metric: net_new_arr }
        - { type: kpi, metric: new_arr }
        - { type: kpi, metric: churned_arr }
        - { type: kpi, metric: accounts }
- type: bar
  metrics: [new_arr, expansion_arr]
  grain: month
  stack: true
  span: 5
```

An inner group takes `direction`, `span` and `blocks`, and draws no card of its own.

## Behavior

* Consecutive KPIs form one strip that follows the group's direction.
* In a row, blocks share the width in proportion to their `span`. A block never gets narrower than
  its minimum; when it would, the row is drawn as a column at that page width.
* A group is as tall as the tallest card in its grid row, so a rail matches the map beside it.
  [Heights](/docs/reference/dashboards.md#heights) has the rules.
* On phones, a row group stacks its blocks and KPIs sit two per row.
* Block ids count the blocks inside groups in the order they are written.

## Checks

| Code | When |
| - | - |
| HM3005 | A group holds fewer than 2 blocks. |
| HM3007 | A group three levels deep, a table in a column, or `title` with `card: false`. |
| HM2035 | A row stacks at 1440 px when a block can't fit, accounting for the sidebar. |
| HM5080 | A group of KPIs fills less than a third of the row beside a taller chart. |

`hatchmark explain <code>` explains a check and how to fix it.


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