---
title: "animateRemoteDpAsState"
description: "Returns a [RemoteDp] that animates towards [targetValue] whenever it changes."
type: "function"
lastmod: "2026-09-24"
---
## API Reference

### animateRemoteDpAsState

> Source set: Android

```kotlin
public fun animateRemoteDpAsState(
    targetValue: RemoteDp,
    animationSpec: RemoteAnimationSpec = remoteTween(),
    initialValue: Float = Float.NaN,
): RemoteDp
```

Returns a [RemoteDp](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDp/api) that animates towards `targetValue` whenever it changes.

#### Parameters

| | |
| --- | --- |
| targetValue | The target value to animate towards. |
| animationSpec | The specification for the animation (e.g. [remoteTween](/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/remoteTween) or [remoteSpring](/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/remoteSpring)). |
| initialValue | Optional initial value if animating from a start value. |
