MaterialSharedAxisY

fun <T> MaterialSharedAxisY(targetState: T, forward: Boolean, modifier: Modifier = Modifier, slideDistance: Dp = MotionConstants.DefaultSlideDistance, label: String = "MaterialSharedAxisY", content: @Composable AnimatedVisibilityScope.(T) -> Unit)(source)

MaterialSharedAxisY allows to switch between two layouts with a shared Y-axis animation.

Parameters

targetState

is a key representing your target layout state. Every time you change a key the animation will be triggered. The content called with the old key will be faded out while the content called with the new key will be faded in.

forward

whether the direction of the animation is forward.

modifier

Modifier to be applied to the animation container.

slideDistance

slide distance of the animation.

label

An optional label to differentiate from other animations in Android Studio.

See also

com.google.android.material.transition.MaterialSharedAxis