Skip to main content

Pane Layout

set-pane-layout — App → stdui

Replaces the current window layout with a new pane tree. The tree is a recursive structure of pane leaves and split nodes. Leaf panes are independently renderable areas; split nodes divide their allocated space among their children.

When set-pane-layout is not called, the layout defaults to a single pane with id "main". The plain-string form of update-content always targets "main", keeping it fully backwards-compatible with single-pane usage.

{
"action": "set-pane-layout",
"data": {
"type": "split",
"direction": "horizontal",
"children": [
{ "type": "pane", "id": "sidebar", "size": 1 },
{
"type": "split",
"direction": "vertical",
"size": 3,
"children": [
{ "type": "pane", "id": "top" },
{ "type": "pane", "id": "bottom" }
]
}
]
}
}

Node fields

FieldRequired forDescription
typeall nodes"pane" for a leaf or "split" for an interior divider
idpane nodesUnique identifier used as the target for update-content
directionsplit nodes"horizontal" (left-to-right) or "vertical" (top-to-bottom)
childrensplit nodesArray of child nodes
sizeall nodesSize hint for the parent split. ≤ 10: relative weight. > 10: fixed pixel size. Defaults to 1

Size semantics

  • size <= 10 — relative weight. After all fixed-pixel children are allocated, the remaining space is divided proportionally. A child with size: 2 gets twice the flexible space of a child with size: 1.
  • size > 10 — fixed pixel size. The child is allocated exactly that many pixels along the split axis regardless of available space.

Mixed fixed and relative children are fully supported within the same split.