Skip to content

@jsvision/ui / LayoutBox

Interface: LayoutBox

Defined in: ui/src/layout/types.ts:95

A node in the layout input tree.

Precondition (caller contract, not runtime-guarded): the tree is acyclic and every box instance is distinct (no node reused at two positions). The pass is a single bounded traversal with no cycle/visited check; a cycle would recurse forever and a reused instance would collide in LayoutResult (which is keyed by box identity → last write wins). Build a fresh tree for each layout rather than reusing box objects.

Properties

children

children: readonly LayoutBox[]

Defined in: ui/src/layout/types.ts:97


measure?

optional measure?: (available) => Size2D

Defined in: ui/src/layout/types.ts:103

Natural content size for an auto box given the available content space (e.g. a label measuring its text). Omitted ⇒ the natural size is derived from children; an auto leaf with no measure resolves to {0,0}.

Parameters

available

Size2D

Returns

Size2D


props

props: LayoutProps

Defined in: ui/src/layout/types.ts:96