Function

sharedElement

Marks this component as a shared element that smoothly transitions its bounds, position, and styling between states in a state layout.

sharedElement

Source set: Android
public fun RemoteModifier.sharedElement(
    key: Int,
    spec: RemoteTweenSpec = remoteTween(),
    enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn,
    exit: RemoteExitTransition = RemoteExitTransition.FadeOut,
): RemoteModifier

Marks this component as a shared element that smoothly transitions its bounds, position, and styling between states in a state layout.

Parameters

key unique integer identifier matching this element across states
spec animation specification for bounds and transforms (e.g. remoteTween)
enter transition effect when component enters the layout
exit transition effect when component exits the layout

Content updated: