LayoutRoot
The rendering engine that turns the layout tree into DOM.
LayoutRoot reads the layout tree from the nearest LayoutProvider and renders it recursively. It delegates all visual decisions to the render props you supply — it owns no markup of its own beyond structural flex containers.
Props
renderPanel (required)
Called once per panel node in the tree. You receive the panel's data and the sizing styles it needs:
The style prop is load-bearing. Spread it onto the outermost element your function returns:
Omitting style will break sizing and collapse.
renderResizer
Optional. When omitted, LayoutRoot renders the built-in <Resizer> component. Provide this when you want full control over the resizer's DOM and styling:
Example — a thin custom resizer:
maximizeMode
Controls how a maximized panel is rendered:
| Value | Behaviour |
|---|---|
'overlay' | The maximized panel covers the full LayoutRoot bounds in an absolute overlay. The underlying tree stays mounted but is hidden (aria-hidden, inert) so focus and scroll position are preserved when un-maximizing. |
'inline' | The library ignores the maximized flag entirely — handle it yourself in renderPanel. |
className / style
Applied to the root container div. Use style to set the height — LayoutRoot fills whatever space its container gives it: