bounds

fun bounds(spec: FiniteAnimationSpec<Float>, reflow: Boolean = false)

Animates mount-space host bounds with spec, like the bounds property.

When reflow is true, a size change drives a real per-frame Yoga relayout — siblings and nested content reflow to the interpolated size each frame — which is what content-driven size changes (text expand/collapse, wrap-content) need and the state-based useAnimatedSize cannot express (it requires an explicit target size). When reflow is false this is identical to setting the bounds property: a visual-only mount animation after layout is already final.

reflow requires state read tracking, enforced at declaration. Width and height animate independently, each from its committed size to its layout-computed natural size; a spec that carries its own values, such as keyframes, still applies them between those endpoints.


Animates mount-space host bounds: x, y, width, and height.

Bounds changes are visual mount animations. Litho still computes the next Yoga layout synchronously, and sibling layout is already in its final state while the host bounds animate. This is useful for smooth movement, expansion, shrink, and reorder effects without per-frame layout. Use state-based animated dimensions when the layout itself should change every frame.