@motion-script/core / FlexChild
Interface: FlexChild
Defined in: layout/flex.ts:17
Minimal child contract the flex strategy needs. Any object that exposes a size mode per axis and can be measured under constraints qualifies — the strategy never touches anything else, so it stays decoupled from SceneNode/TransformNode and is reusable outside the node tree.
Properties
gapScale?
optionalgapScale?:number
Defined in: layout/flex.ts:33
Per-child gap weight in [0, 1] for animated insert/remove: the fraction
of a full gap this child contributes on each of its sides. Undefined → 1
(normal layout). The animated addChildAt/removeChildAt overloads tween
this 0 ↔ 1 so a collapsing/growing child opens or closes exactly one
gap's worth of space in lockstep with its box.
heightMode
heightMode:
SizeInput
Defined in: layout/flex.ts:19
mainFlex?
optionalmainFlex?:number
Defined in: layout/flex.ts:25
Proportional weight for dividing the main-axis free space among fill
children. Only consulted when this child fills the main axis; ignored
otherwise. Undefined is treated as 1.
widthMode
widthMode:
SizeInput
Defined in: layout/flex.ts:18
Methods
measure()
measure(
constraints):Partial<Size2D>
Defined in: layout/flex.ts:34
Parameters
constraints
Returns
Partial<Size2D>