RemoteTextButton

Functions summary

Unit
@Composable
@RemoteComposable
RemoteTextButton(
    onClick: RemoteAction,
    modifier: RemoteModifier,
    enabled: RemoteBoolean,
    shape: RemoteShape,
    colors: RemoteTextButtonColors,
    border: RemoteBorderStroke?,
    content: @Composable @RemoteComposable () -> Unit
)

Wear Material RemoteTextButton is a circular, text-only button with transparent background and no border.

Functions

@Composable
@RemoteComposable
fun RemoteTextButton(
    onClick: RemoteAction,
    modifier: RemoteModifier = RemoteModifier,
    enabled: RemoteBoolean = true.rb,
    shape: RemoteShape = RemoteTextButtonDefaults.shape,
    colors: RemoteTextButtonColors = RemoteTextButtonDefaults.textButtonColors(),
    border: RemoteBorderStroke? = null,
    content: @Composable @RemoteComposable () -> Unit
): Unit

Wear Material RemoteTextButton is a circular, text-only button with transparent background and no border. It offers a single slot for text.

The default RemoteTextButton has no border and a transparent background for low emphasis actions. For actions that require higher emphasis, consider overriding the colors by RemoteTextButtonColors.copy

RemoteTextButton can be enabled or disabled. A disabled button will not respond to click events.

Example of a RemoteTextButton:

import androidx.compose.remote.creation.compose.action.valueChange
import androidx.compose.remote.creation.compose.state.MutableRemoteInt
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.runtime.remember
import androidx.wear.compose.remote.material3.RemoteText
import androidx.wear.compose.remote.material3.RemoteTextButton

val tapCount = remember { MutableRemoteInt(0) }
val text = "+".rs + tapCount.toRemoteString()

RemoteTextButton(
    valueChange(tapCount, tapCount + 1),
    modifier = modifier,
    colors = filledTonalColor(),
) {
    RemoteText(text = text)
}
Parameters
onClick: RemoteAction

Will be called when the user clicks the button.

modifier: RemoteModifier = RemoteModifier

Modifier to be applied to the button.

enabled: RemoteBoolean = true.rb

Controls the enabled state of the button. When false, this button will not be clickable. It must be a constant value.

shape: RemoteShape = RemoteTextButtonDefaults.shape

Defines the shape for this button. Defaults to a static shape based on RemoteTextButtonDefaults.shape

colors: RemoteTextButtonColors = RemoteTextButtonDefaults.textButtonColors()

RemoteTextButtonColors that will be used to resolve the background and content color for this button in different states.

border: RemoteBorderStroke? = null

Optional RemoteBorderStroke that will be used to resolve the border for this button in different states.

content: @Composable @RemoteComposable () -> Unit

The content displayed on the text button, expected to be text or image.