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: JvmAndAndroid
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 non-zero 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

Return

a RemoteModifier that marks this component as a shared element

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: