---
title: "AnimateStyleScope"
description: "An interface that introduces animate functions to a Style receiver scope."
type: "interface"
lastmod: "2026-05-20T01:13:53.357372Z"
---
## API Reference

> Source set: Common

```kotlin
@ExperimentalFoundationStyleApi
interface AnimateStyleScope
```

An interface that introduces [animate](/jetpack-compose/androidx.compose.foundation/foundation/functions/animate) functions to a [Style](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Style) receiver scope.

## Functions

### animate

```kotlin
fun animate(toSpec: AnimationSpec<Float>, fromSpec: AnimationSpec<Float>, block: () -> Unit)
```

Specifies a [Style](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Style) whose properties will be animated to when they change, using the provided
[AnimationSpec](/jetpack-compose/androidx.compose.animation/animation-core/interfaces/AnimationSpec). This allows for smooth transitions between style states with custom
animation curves.

#### Parameters

| | |
| --- | --- |
| toSpec | The [AnimationSpec](/jetpack-compose/androidx.compose.animation/animation-core/interfaces/AnimationSpec) to use for the animation to the values set in `block`. This animation is used when the [animate](/jetpack-compose/androidx.compose.foundation/foundation/functions/animate) call is added to the style. |
| fromSpec | The [AnimationSpec](/jetpack-compose/androidx.compose.animation/animation-core/interfaces/AnimationSpec) to use for the animation from the values set in `block`. This animation is used when the [animate](/jetpack-compose/androidx.compose.foundation/foundation/functions/animate) call is removed from the style. |
| block | The block containing the properties values to animate |
