<div class='sourceset sourceset-android'>Android</div>

```kotlin
public class RemoteDp
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
internal constructor(
    @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public val value: RemoteFloat
) : BaseRemoteState<Dp>()
```

Represents a Density-independent pixel (Dp) value.

`RemoteDp` represents a Dp value that can be a constant, a named variable, or a dynamic
expression.

## Functions

<h2 id="topx-density">toPx</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun toPx(density: RemoteDensity): RemoteFloat
```

Function to convert this [RemoteDp](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDp) to a density-independent pixel value. It multiplies the
current float value by the screen\'s density.

<hr class="docs-overload-divider">

<h2 id="topx">toPx</h2>

```kotlin
public fun toPx(): RemoteFloat
```

Converts a RemoteDp to a RemoteFloat Px using the [RemoteDensity](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDensity).

## Companion Object

#### Methods

<hr class="docs-overload-divider">

<h2 id="invoke-value">invoke</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public operator fun invoke(value: Dp): RemoteDp
```

Creates a [RemoteDp](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDp) from a literal `Dp` value.

#### Parameters

| | |
| --- | --- |
| value | The `Dp` value. |

#### Returns

| | |
| --- | --- |
|  | A [RemoteDp](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDp) representing the constant Dp. |

<hr class="docs-overload-divider">

<h2 id="createnamedremotedp-name-defaultvalue-domain">createNamedRemoteDp</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
@JvmStatic
        public fun createNamedRemoteDp(
            name: String,
            defaultValue: Dp,
            domain: RemoteState.Domain = RemoteState.Domain.User,
        ): RemoteDp
```

Creates a named [RemoteDp](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDp) with an initial value.

Named remote Dps can be set via AndroidRemoteContext.setNamedFloat.

#### Parameters

| | |
| --- | --- |
| name | A unique name to identify this state within its `domain`. |
| defaultValue | The initial `Dp` value for the named remote Dp. |
| domain | The domain for the named state. Defaults to [RemoteState.Domain.User](/jetpack-compose/androidx.compose.remote/remote-creation-compose/objects/RemoteState.Domain.User). |

#### Returns

| | |
| --- | --- |
|  | A [RemoteDp](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDp) representing the named Dp. |