---
title: "layout.apply: Tidy up — Board kit command — Kition"
description: "Tidies a diagram: lays the boxes and the connectors among them out again in layers (no overlaps, connectors between facing sides, around boxes rather than through them), leaving locked, grouped, turned and mind-map elements where they are; answers what moved and what it left."
canonical: "https://developer.kition.ai/docs/kits/board/commands/layout.apply"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/board/commands/layout.apply](https://developer.kition.ai/docs/kits/board/commands/layout.apply)

# layout.apply

**Tidy up.** Tidies a diagram: lays the boxes and the connectors among them out again in layers (no overlaps, connectors between facing sides, around boxes rather than through them), leaving locked, grouped, turned and mind-map elements where they are; answers what moved and what it left.

- Kit: Board 0.1.0 (.kboard); reference: [Board kit commands](https://developer.kition.ai/docs/kits/board.md)
- Changes the document: yes
- Acts on: `ids` (a list of ids), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `direction` | `"down" \| "right" \| "up" \| "left"` | no | Where the diagram grows (the way most of its connectors go now, when absent) |
| `ids` | `string[]` | no | The boxes to lay out with the connectors among them (a frame: what it holds); when absent, every box on the page joined to another by a connector |
| `page` | `string` | no | The page whose connected boxes to lay out, when ids is absent; the shown page by default |

## Call through board_run

```text
board_run {
  "path": "<file>.kboard",
  "steps": [{ "command": "layout.apply" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `direction`, `ids`, `page`. board_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "direction": {
      "description": "Where the diagram grows (the way most of its connectors go now, when absent)",
      "enum": [
        "down",
        "right",
        "up",
        "left"
      ],
      "type": "string"
    },
    "ids": {
      "description": "The boxes to lay out with the connectors among them (a frame: what it holds); when absent, every box on the page joined to another by a connector",
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-khp-types": [
        "Element"
      ]
    },
    "page": {
      "description": "The page whose connected boxes to lay out, when ids is absent; the shown page by default",
      "type": "string",
      "x-khp-types": [
        "Page"
      ]
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/board-darwin-arm64@0.1.0 and the kit itself (board_commands through @kition/cli@0.1.1, built from KitionAI/kition-board@e78c190).
