AnimatedVisibility
A container that animates its content entering and exiting the render tree.
When visible transitions false -> true, the content is mounted and the enter animation plays. When visible transitions true -> false, the exit animation plays and the content is kept mounted (in this container's own subtree) until the animation settles, then unmounted. This is the "container-owned retention" model — the same one Jetpack Compose uses by keeping exiting content in composition. No DisappearingHost / rendercore machinery is involved.
child(AnimatedVisibility(visible = show) { Text(text = "Hello") })
child(
AnimatedVisibility(
visible = expanded,
enter = fadeIn(tween(300.ms)) + slideInVertically { -it },
exit = fadeOut(tween(200.ms)) + slideOutVertically { it },
) { ExpandedContent() })Parameters
Constructors
Functions
This indicates the type of the Object that will be returned by mount.
Compares this component to a different one to check if they are the same
Should not be used! Components should be manually measured only as part of a LayoutState calculation. This will measure a component and set the size in the outputSize object but the measurement result will not be cached and reused for future measurements of this component.
Returns the component's resolve result for a deferred resolution. The framework invokes this instead of the resolve if the component needs to defer its resolution until layout.