# remoteComponent

> Returns a [RemoteComponent] bound to this [RemoteStateScope]'s active component.

## API Reference

### remoteComponent

> Source set: JvmAndAndroid

```kotlin
public fun RemoteStateScope.remoteComponent(): RemoteComponent
```

Returns a `RemoteComponent` bound to this [RemoteStateScope](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/interfaces/RemoteStateScope/api.md)'s active component.

* Resolves to the target layout component when called from a [RemoteModifier](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/interfaces/RemoteModifier/api.md) or [RemoteAction](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/interfaces/RemoteAction/api.md)
scope (such as [drawWithContent](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/drawWithContent/api.md)).
* Resolves to the component currently being drawn when called from a [RemoteDrawScope](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteDrawScope/api.md) or
[RemoteCanvas](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/composable-functions/RemoteCanvas/api.md).

#### Return

[RemoteComponent](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/remoteComponent/api.md) bound to the active component in this [RemoteStateScope](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/interfaces/RemoteStateScope/api.md)

## Code Examples

### RemoteComponentDrawScopeSample

```kotlin
@Sampled
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteComponentDrawScopeSample() {
    RemoteBox(
        modifier =
            RemoteModifier.size(160.rdp).drawWithContent {
                val component = remoteComponent()
                val paint = RemotePaint().apply { color = Color.Cyan.rc }
                drawCircle(
                    paint = paint,
                    radius = component.width * 0.4f,
                    center = RemoteOffset(component.centerX, component.centerY),
                )
                drawContent()
            }
    )
}
```
