Function

remoteComponent

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

RemoteComponentDrawScopeSample

@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()
            }
    )
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: