docs / layout
gru · 0.8.0 · main
Layout
Short author rules for height, scroll, and the composition stack. Name the mode before you fight bounds.
One job per layer
Document.Root → shell → (grid) → (Viewport) → Panel/Card → widgets
Overlays (modals, dropdowns) draw above the tree and must not change sibling layout extent.
Height modes
| Mode | Meaning |
|---|---|
| Intrinsic | Shrink-wrap content at assigned width |
| Fill | Consume remaining main-axis space (FlexGrow) |
| Fixed | Exact height band |
Pick one per node. Measure width-first. Never leave probe/measure heights as final bounds.
Scroll owner
| Need | Use |
|---|---|
| Page scrolls as a document | One page-scroll Viewport in the shell body |
| Pane fills remaining height | FlexGrow fill child (optional nested Viewport) |
| Modal | Flat flex body only — not a Viewport root |
Canonical: LAYOUT.md · deeper: architecture/layout.md.
Next: Composition · Architecture · WebView