Compose Unstyled 2.0 is out! Check the official announcement blog ->
Function

animate

Specifies a Style whose properties will be animated to when they change.

animate

Source set: Common
@ExperimentalFoundationStyleApi
fun AnimateStyleScope.animate(block: () -> Unit)

Specifies a Style whose properties will be animated to when they change. This uses a default animation specification. This allows for smooth transitions between style states without manual animation setup. A androidx.compose.animation.core.spring will be used for the animation for both animating to and from the style.

Parameters

block The target Style whose properties should be animated.

animate

Source set: Common
@ExperimentalFoundationStyleApi
fun AnimateStyleScope.animate(spec: AnimationSpec<Float>, block: () -> Unit)

Specifies a Style whose properties will be animated to when they change, using the provided AnimationSpec. This allows for smooth transitions between style states with custom animation curves. The same animation spec will be used for animating both to and from the style.

Parameters

spec The AnimationSpec to use for the animation.
block The target Style whose properties should be animated.

Last updated: