We just launched Compose Examples featuring over 150+ components! Check it out →

SharedTransitionLayout

Common

Component in Compose Animation

[SharedTransitionLayout] creates a layout and a [SharedTransitionScope] for the child layouts in [content]. Any child (direct or indirect) of the [SharedTransitionLayout] can use the receiver scope [SharedTransitionScope] to create shared element or shared bounds transitions.

Last updated:

Installation

dependencies {
   implementation("androidx.compose.animation:animation:1.8.0-alpha01")
}

Overloads

@ExperimentalSharedTransitionApi
@Composable
fun SharedTransitionLayout(
    modifier: Modifier = Modifier,
    content: @Composable SharedTransitionScope.() -> Unit
)

Parameters

namedescription
modifierModifiers to be applied to the layout.
contentThe children composable to be laid out.
by @alexstyl