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

ModeMeaning
IntrinsicShrink-wrap content at assigned width
FillConsume remaining main-axis space (FlexGrow)
FixedExact height band

Pick one per node. Measure width-first. Never leave probe/measure heights as final bounds.

Scroll owner

NeedUse
Page scrolls as a documentOne page-scroll Viewport in the shell body
Pane fills remaining heightFlexGrow fill child (optional nested Viewport)
ModalFlat flex body only — not a Viewport root

Canonical: LAYOUT.md · deeper: architecture/layout.md.

Next: Composition · Architecture · WebView