Responsive layout builder

Draw the layout.Ship the code.

A page layout is a binary tree of flex splits, and that is exactly what you drag here. Layout writes the matching JSX + Tailwind or HTML + CSS, then hands you a JSON spec and an LLM prompt — so the structure survives the handoff instead of being re-described in prose.

Split
a flex container — row or column
Drag
flex-[0.62] on the child, clamped 0.1–0.9
Export
jsx · css · json · prompt, from one tree

No account and no server round-trip: the tree lives in localStorage and every export is generated locally.

Fig. 01 — live spec

3 panes · depth 3 · holy-grail

Sidebar
Header
Main

Hand the structure to a coding agent instead of describing it in prose.

layout-prompt.txt
Implement this page layout as a single self-contained React component.

STRUCTURE
```
row                  100%
├─ leaf "Sidebar"    22%
└─ col               78%
   ├─ leaf "Header"  14%
   └─ leaf "Main"    86%
```

SPEC (the same tree, machine readable)
```json
{
  "direction": "row",
  "children": [
    {
      "pane": "Sidebar",
      "ratio": 0.22
    },
    {
      "direction": "col",
      "ratio": 0.78,
      "children": [
        {
          "pane": "Header",
          "ratio": 0.14
        },
        {
          "pane": "Main",
          "ratio": 0.86
        }
      ]
    }
  ]
}
```

HOW TO READ IT
- A split is a flex container: `row` → flex-direction row, `col` → column.
- `ratio` is a child's share of its parent, always between 0.1 and 0.9. It is proportional,
  never a pixel width, so the layout scales with the viewport.
- 3 leaf panes at 3 levels. Every leaf must appear in the output.

RULES
1. Keep the nesting order and every ratio exactly as given.
2. Root container: `flex h-dvh w-full overflow-hidden`. Add `min-w-0 min-h-0` to any child
   that must be allowed to shrink.
3. Translate each ratio to Tailwind `flex-[<ratio>]` — 0.25 becomes `flex-[0.25]`. Do not
   round ratios into a 12-column grid.
4. Label every pane with a `/* comment */` and a 1px border so the split is visible.
5. No absolute positioning, no fixed heights, no media queries — the ratios already describe
   the responsive behaviour.

OUTPUT: one .tsx file exporting `PageLayout`.
/ 01

What it does

  • 01

    Split

    Split the selected pane horizontally or vertically. The new pane takes half and inherits its parent's place in the tree.

  • 02

    Resize

    Drag any divider, or focus it and press an arrow key. Ratios clamp at 0.1–0.9 and the generated code updates as you move.

  • 03

    Reset a split

    Double-click a divider — or press Home on it — to snap that pair back to 50/50.

  • 04

    Rearrange

    Drag one pane onto another to swap their labels and colours without restructuring the tree.

  • 05

    Delete

    Removing a pane collapses its parent split. The root pane is the layout itself, so it stays.

  • 06

    Export JSX + Tailwind

    Flex markup with a flex-[ratio] on every child, written as a component you can drop in.

  • 07

    Export HTML + CSS

    Generated class names with proportional flex values, for when Tailwind isn't the target.

  • 08

    JSON spec

    The tree itself: small, ordered, and re-importable. Fits in a Slack message or an issue.

    New
  • 09

    LLM prompt

    The tree plus the rules for reading it, addressed to a coding agent — so it builds what you drew, not what it guessed.

    New
  • 10

    Import a spec

    Paste any spec back into the canvas and it rebuilds. Malformed input is rejected with the reason, never half-applied.

    New
  • 11

    Persistence

    The tree is kept in localStorage, so a refresh, a crash or a closed tab doesn't lose the layout.

Ratios are proportional, never pixel widths — that is the whole reason one tree holds up from 360px to 1440px without a media query.

Open the builder
/ 02

Five ways out of the canvas

Cursor · Claude Code · Copilot Chat · The prompt carries the split order, the ratios and the rules the agent would otherwise invent. Ask for the component and you get the layout you drew.

layout-prompt.txt
Implement this page layout as a single self-contained React component.

STRUCTURE
```
row                  100%
├─ leaf "Sidebar"    22%
└─ col               78%
   ├─ leaf "Header"  14%
   └─ leaf "Main"    86%
```

SPEC (the same tree, machine readable)
```json
{
  "direction": "row",
  "children": [
    {
      "pane": "Sidebar",
      "ratio": 0.22
    },
    {
      "direction": "col",
      "ratio": 0.78,
      "children": [
        {
          "pane": "Header",
          "ratio": 0.14
        },
        {
          "pane": "Main",
          "ratio": 0.86
        }
      ]
    }
  ]
}
```

HOW TO READ IT
- A split is a flex container: `row` → flex-direction row, `col` → column.
- `ratio` is a child's share of its parent, always between 0.1 and 0.9. It is proportional,
  never a pixel width, so the layout scales with the viewport.
- 3 leaf panes at 3 levels. Every leaf must appear in the output.

RULES
1. Keep the nesting order and every ratio exactly as given.
2. Root container: `flex h-dvh w-full overflow-hidden`. Add `min-w-0 min-h-0` to any child
   that must be allowed to shrink.
3. Translate each ratio to Tailwind `flex-[<ratio>]` — 0.25 becomes `flex-[0.25]`. Do not
   round ratios into a 12-column grid.
4. Label every pane with a `/* comment */` and a 1px border so the split is visible.
5. No absolute positioning, no fixed heights, no media queries — the ratios already describe
   the responsive behaviour.

OUTPUT: one .tsx file exporting `PageLayout`.
/ 03

Three moves

  1. 01

    Split

    Choose a direction, then split the pane you have selected. Panes are a binary tree, so a three-column band is simply a row inside a row.

  2. 02

    Tune

    Drag any divider, or focus it and use the arrow keys. Ratios stay proportional and clamped, and every export follows in real time.

  3. 03

    Export

    Take the JSX, the HTML, the JSON spec or the prompt. Paste the spec back into the canvas whenever you want to keep editing it.

Keyboard: Tab reaches every pane and divider. Enter selects a pane, ← / → moves a vertical divider, ↑ / ↓ moves a horizontal one, and Home restores 50/50.

/ 04

Revision log

Rev 0.1 — shipped
  • JSON spec exportThe whole tree, ordered and re-importable.
  • LLM prompt exportStructure, ratios and the rules for reading them.
  • Import a specRebuilds the canvas from pasted JSON, with validation and a reason on failure.
Not built yet
  • Undo / redoSoon

    A 50-action history over the tree.

  • Breakpoint modelSoon

    A different tree per size, with sm / md / lg previews.

  • Grid layoutsSoon

    Column tracks alongside flex splits.

  • More targetsSoon

    Vue, Svelte and plain component templates.

The tree is binary and flex-only by design. Breakpoints are the next thing it has to express, and that changes the node model — which is why it isn't here yet.