SpatialTransitions

object SpatialTransitions


Public transition spec APIs for use with AnimatedSpatialVisibility.

Summary

Public functions

SpatialEnterTransition
fadeIn(animationSpec: FiniteAnimationSpec<Float>, initialAlpha: Float)

This fades in the content of the transition, from the specified starting alpha (i.e. initialAlpha) to 1f, using the supplied animationSpec.

SpatialExitTransition
fadeOut(animationSpec: FiniteAnimationSpec<Float>, targetAlpha: Float)

This fades out the content of the transition, from full opacity to the specified target alpha (i.e. targetAlpha), using the supplied animationSpec.

SpatialEnterTransition
slideIn(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    initialOffset: Density.(fullSize: IntVolumeSize) -> IntVolumeOffset
)

This slides in the content of the transition, from a starting offset defined in initialOffset to IntVolumeOffset(0, 0, 0).

SpatialEnterTransition
slideInDepth(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    initialOffsetZ: Density.(fullDepth: Int) -> Int
)

This slides in the content depthwise, from a starting offset defined in initialOffsetZ to 0 pixels.

SpatialEnterTransition
slideInHorizontally(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    initialOffsetX: Density.(fullWidth: Int) -> Int
)

This slides in the content horizontally, from a starting offset defined in initialOffsetX to 0 pixels.

SpatialEnterTransition
slideInVertically(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    initialOffsetY: Density.(fullHeight: Int) -> Int
)

This slides in the content vertically, from a starting offset defined in initialOffsetY to 0 pixels.

SpatialExitTransition
slideOut(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    targetOffset: Density.(fullSize: IntVolumeSize) -> IntVolumeOffset
)

This slides out the content of the transition, from an offset of IntVolumeOffset(0, 0, 0) to the target offset defined in targetOffset.

SpatialExitTransition
slideOutDepth(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    targetOffsetZ: Density.(fullDepth: Int) -> Int
)

This slides out the content depthwise, from 0 to a target offset defined in targetOffsetZ in pixels.

SpatialExitTransition
slideOutHorizontally(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    targetOffsetX: Density.(fullWidth: Int) -> Int
)

This slides out the content horizontally, from 0 to a target offset defined in targetOffsetX in pixels.

SpatialExitTransition
slideOutVertically(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset>,
    targetOffsetY: Density.(fullHeight: Int) -> Int
)

This slides out the content vertically, from 0 to a target offset defined in targetOffsetY in pixels.

Public functions

fadeIn

Added in 1.0.0-alpha09
fun fadeIn(
    animationSpec: FiniteAnimationSpec<Float> = SpatialTransitionDefaults.DefaultAlphaAnimationSpec,
    initialAlpha: Float = 0.0f
): SpatialEnterTransition

This fades in the content of the transition, from the specified starting alpha (i.e. initialAlpha) to 1f, using the supplied animationSpec. initialAlpha defaults to 0f, and spring is used by default.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.spring
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        enter = SpatialTransitions.fadeIn(initialAlpha = 0.5f),
        exit =
            SpatialTransitions.fadeOut(
                animationSpec = spring(stiffness = Spring.StiffnessVeryLow)
            ),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<Float> = SpatialTransitionDefaults.DefaultAlphaAnimationSpec

the FiniteAnimationSpec for this animation, spring by default

initialAlpha: Float = 0.0f

the starting alpha of the enter transition, 0f by default

fadeOut

Added in 1.0.0-alpha09
fun fadeOut(
    animationSpec: FiniteAnimationSpec<Float> = SpatialTransitionDefaults.DefaultAlphaAnimationSpec,
    targetAlpha: Float = 0.0f
): SpatialExitTransition

This fades out the content of the transition, from full opacity to the specified target alpha (i.e. targetAlpha), using the supplied animationSpec. By default, the content will be faded out to fully transparent (i.e. targetAlpha defaults to 0), and animationSpec uses spring by default.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.spring
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        enter = SpatialTransitions.fadeIn(initialAlpha = 0.5f),
        exit =
            SpatialTransitions.fadeOut(
                animationSpec = spring(stiffness = Spring.StiffnessVeryLow)
            ),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<Float> = SpatialTransitionDefaults.DefaultAlphaAnimationSpec

the FiniteAnimationSpec for this animation, spring by default

targetAlpha: Float = 0.0f

the target alpha of the exit transition, 0f by default

slideIn

Added in 1.0.0-alpha09
fun slideIn(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    initialOffset: Density.(fullSize: IntVolumeSize) -> IntVolumeOffset
): SpatialEnterTransition

This slides in the content of the transition, from a starting offset defined in initialOffset to IntVolumeOffset(0, 0, 0). The direction of the slide can be controlled by configuring the initialOffset. A positive x value means sliding from right to left, whereas a negative x value will slide the content to the right. Similarly positive and negative y values correspond to sliding up and down, respectively, and positive and negative z values correspond to sliding closer and further, respectively.

If the sliding is only desired along one axis, consider using slideInHorizontally, slideInVertically, or slideInDepth.

initialOffset is a lambda that takes the full size of the content and returns an offset. This allows the offset to be defined proportional to the full size, or as an absolute value.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-in, spring by default.

initialOffset: Density.(fullSize: IntVolumeSize) -> IntVolumeOffset

a lambda that takes the full size of the content and returns the initial offset for the slide-in

slideInDepth

Added in 1.0.0-alpha09
fun slideInDepth(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    initialOffsetZ: Density.(fullDepth: Int) -> Int = { -20.dp.roundToPx() }
): SpatialEnterTransition

This slides in the content depthwise, from a starting offset defined in initialOffsetZ to 0 pixels. The direction of the slide can be controlled by configuring the initialOffsetZ. A positive value means sliding from close to far, whereas a negative value would slide the content from far to close.

initialOffsetZ is a lambda that takes the full depth of the content and returns an offset. This allows the starting offset to be defined proportional to the full size, or as an absolute value.

Unlike slideInVertically and slideInHorizontally, this defaults to sliding in from 20dp away from the neutral depth point. This is because many commonly-animated Spatial elements, such as SpatialPanel, report a depth of 0.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-in, spring by default.

initialOffsetZ: Density.(fullDepth: Int) -> Int = { -20.dp.roundToPx() }

a lambda that takes the full height of the content in pixels and returns the initial offset for the slide-in, by default it returns -20.dp.toPx()

slideInHorizontally

Added in 1.0.0-alpha09
fun slideInHorizontally(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    initialOffsetX: Density.(fullWidth: Int) -> Int = { -it / 2 }
): SpatialEnterTransition

This slides in the content horizontally, from a starting offset defined in initialOffsetX to 0 pixels. The direction of the slide can be controlled by configuring the initialOffsetX. A positive value means sliding from right to left, whereas a negative value would slide the content from left to right.

initialOffsetX is a lambda that takes the full width of the content and returns an offset. This allows the starting offset to be defined proportional to the full size, or as an absolute value. It defaults to return half of negative width, which would offset the content to the left by half of its width, and slide towards the right.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-in, spring by default.

initialOffsetX: Density.(fullWidth: Int) -> Int = { -it / 2 }

a lambda that takes the full width of the content in pixels and returns the initial offset for the slide-in, by default it returns -fullWidth/2

slideInVertically

Added in 1.0.0-alpha09
fun slideInVertically(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    initialOffsetY: Density.(fullHeight: Int) -> Int = { -it / 2 }
): SpatialEnterTransition

This slides in the content vertically, from a starting offset defined in initialOffsetY to 0 pixels. The direction of the slide can be controlled by configuring the initialOffsetY. A positive value means sliding from top to bottom, whereas a negative value would slide the content from bottom to top.

initialOffsetY is a lambda that takes the full height of the content and returns an offset. This allows the starting offset to be defined proportional to the full size, or as an absolute value. It defaults to return half of negative height, which would offset the content down by half of its height, and slide upwards.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-in, spring by default.

initialOffsetY: Density.(fullHeight: Int) -> Int = { -it / 2 }

a lambda that takes the full height of the content in pixels and returns the initial offset for the slide-in, by default it returns -fullHeight/2

slideOut

Added in 1.0.0-alpha09
fun slideOut(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    targetOffset: Density.(fullSize: IntVolumeSize) -> IntVolumeOffset
): SpatialExitTransition

This slides out the content of the transition, from an offset of IntVolumeOffset(0, 0, 0) to the target offset defined in targetOffset. The direction of the slide can be controlled by configuring the targetOffset. A positive x value means sliding from left to right, whereas a negative x value would slide the content from right to left. Similarly, positive and negative y values correspond to sliding down and up, respectively, and positive and negative z values correspond to sliding closer and further, respectively.

If the sliding is only desired along one axis, consider using slideOutHorizontally, slideOutVertically, or slideOutDepth.

targetOffset is a lambda that takes the full size of the content and returns an offset. This allows the offset to be defined proportional to the full size, or as an absolute value.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-out, spring by default.

targetOffset: Density.(fullSize: IntVolumeSize) -> IntVolumeOffset

a lambda that takes the full size of the content and returns the target offset for the slide-out

slideOutDepth

Added in 1.0.0-alpha09
fun slideOutDepth(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    targetOffsetZ: Density.(fullDepth: Int) -> Int = { -20.dp.roundToPx() }
): SpatialExitTransition

This slides out the content depthwise, from 0 to a target offset defined in targetOffsetZ in pixels. The direction of the slide-out can be controlled by configuring the targetOffsetZ. A positive value means sliding from close to far, whereas a negative value would slide the content from far to close.

targetOffsetZ is a lambda that takes the full depth of the content and returns an offset. This allows the target offset to be defined proportional to the full depth, or as an absolute value.

Unlike slideInVertically and slideInHorizontally, this defaults to sliding in from 20dp away from the neutral depth point. This is because many commonly-animated Spatial elements, such as SpatialPanel, report a depth of 0.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-out, spring by default.

targetOffsetZ: Density.(fullDepth: Int) -> Int = { -20.dp.roundToPx() }

a lambda that takes the full depth of the content and returns the target offset for the slide-out, by default it returns -20.dp.toPx()

slideOutHorizontally

Added in 1.0.0-alpha09
fun slideOutHorizontally(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    targetOffsetX: Density.(fullWidth: Int) -> Int = { -it / 2 }
): SpatialExitTransition

This slides out the content horizontally, from 0 to a target offset defined in targetOffsetX in pixels. The direction of the slide can be controlled by configuring the targetOffsetX. A positive value means sliding to the right, whereas a negative value would slide the content towards the left.

targetOffsetX is a lambda that takes the full width of the content and returns an offset. This allows the target offset to be defined proportional to the full size, or as an absolute value. It defaults to return half of negative width, which would slide the content to the left by half of its width.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-out, spring by default.

targetOffsetX: Density.(fullWidth: Int) -> Int = { -it / 2 }

a lambda that takes the full width of the content and returns the initial offset for the slide-in, by default it returns fullWidth/2

slideOutVertically

Added in 1.0.0-alpha09
fun slideOutVertically(
    animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec,
    targetOffsetY: Density.(fullHeight: Int) -> Int = { -it / 2 }
): SpatialExitTransition

This slides out the content vertically, from 0 to a target offset defined in targetOffsetY in pixels. The direction of the slide-out can be controlled by configuring the targetOffsetY. A positive target offset means sliding down, whereas a negative value would slide the content up.

targetOffsetY is a lambda that takes the full Height of the content and returns an offset. This allows the target offset to be defined proportional to the full height, or as an absolute value. It defaults to return half of the negative height, which would slide the content up by half of its Height.

import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.material3.Text
import androidx.compose.runtime.remember
import androidx.xr.compose.spatial.Subspace
import androidx.xr.compose.subspace.SpatialPanel
import androidx.xr.compose.subspace.animation.AnimatedSpatialVisibility
import androidx.xr.compose.subspace.animation.SpatialTransitions
import androidx.xr.compose.unit.IntVolumeOffset

Subspace {
    val visibleState = remember { MutableTransitionState(false) }
    visibleState.targetState = true

    AnimatedSpatialVisibility(
        visibleState = visibleState,
        // if sliding on multiple axes, an initial/target point must be given
        enter =
            SpatialTransitions.slideIn { size ->
                IntVolumeOffset(
                    // negative x: from left to right
                    x = -size.width / 2,
                    // negative y: from bottom to top
                    y = -size.height / 2,
                    // negative z: from far to close
                    z = -size.depth / 2,
                )
            },
        // defaults are provided when only sliding on one axis
        exit = SpatialTransitions.slideOutHorizontally(),
    ) {
        SpatialPanel { Text("Spatial panel") }
    }
}
Parameters
animationSpec: FiniteAnimationSpec<IntVolumeOffset> = SpatialTransitionDefaults.DefaultSlideAnimationSpec

the animation used for the slide-out, spring by default.

targetOffsetY: Density.(fullHeight: Int) -> Int = { -it / 2 }

a lambda that takes the full Height of the content and returns the target offset for the slide-out, by default it returns fullHeight/2