Composable Function

remoteComponent

Returns a RemoteComponent bound to the enclosing layout component.

RemoteComponentSample

@Sampled
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteComponentSample() {
    RemoteColumn(modifier = RemoteModifier.size(200.rdp).background(Color.LightGray.rc)) {
        val parentHeight = remoteComponent().height
        RemoteBox(
            modifier =
                RemoteModifier.fillMaxWidth()
                    .height((parentHeight * 0.5f).toRemoteDp())
                    .background(Color.Blue.rc)
        )
    }
}
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: