Function

hostAction

Creates a RemoteAction that triggers a named action on the host.

HostActionSample

@Sampled
@Preview
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun HostActionSample() {
    RemoteBox(
        modifier =
            RemoteModifier.clip(RemoteRoundedCornerShape(12.rdp))
                .background(Color(0xFF1E88E5).rc)
                .clickable(hostAction(name = "open_details".rs))
                .padding(16.rdp),
        contentAlignment = RemoteAlignment.Center,
    ) {
        RemoteText(text = "Open Details".rs, color = Color.White.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: