Composable Function

RemoteEdgeButton

Wear Material 3 RemoteEdgeButton that offers a single slot to take any content.

RemoteEdgeButtonSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteEdgeButtonSample(modifier: RemoteModifier = RemoteModifier) {
    val tapCount = remember { MutableRemoteInt(0) }
    val countSuffix = " (".rs + tapCount.toRemoteString() + " taps)"

    RemoteEdgeButton(
        onClick = valueChange(tapCount, tapCount + 1),
        modifier = modifier,
        buttonSize = RemoteEdgeButtonSize.Small,
    ) {
        RemoteText("Tap me!".rs + countSuffix)
    }
}

RemoteEdgeButtonIconSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteEdgeButtonIconSample(modifier: RemoteModifier = RemoteModifier) {
    val tapCount = remember { MutableRemoteInt(0) }

    RemoteEdgeButton(
        onClick = valueChange(tapCount, tapCount + 1),
        modifier = modifier,
        buttonSize = RemoteEdgeButtonSize.ExtraSmall,
    ) {
        RemoteIcon(
            imageVector = TestImageVectors.VolumeUp,
            contentDescription = "Volume Up".rs,
            modifier =
                RemoteModifier.size(
                    RemoteEdgeButtonDefaults.iconSizeFor(RemoteEdgeButtonSize.ExtraSmall)
                ),
        )
    }
}

RemoteEdgeButtonFilledTonalSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteEdgeButtonFilledTonalSample(modifier: RemoteModifier = RemoteModifier) {
    val tapCount = remember { MutableRemoteInt(0) }

    RemoteEdgeButton(
        onClick = valueChange(tapCount, tapCount + 1),
        modifier = modifier,
        buttonSize = RemoteEdgeButtonSize.Medium,
        colors = RemoteEdgeButtonDefaults.filledTonalButtonColors(),
    ) {
        RemoteText("Filled Tonal".rs)
    }
}

RemoteEdgeButtonMultiLineSample

@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteEdgeButtonMultiLineSample(modifier: RemoteModifier = RemoteModifier) {
    val tapCount = remember { MutableRemoteInt(0) }

    RemoteEdgeButton(
        onClick = valueChange(tapCount, tapCount + 1),
        modifier = modifier,
        buttonSize = RemoteEdgeButtonSize.Large,
    ) {
        RemoteText("Longer multi-line\nShort label".rs)
    }
}
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: