RemoteTextButton

Functions summary

Unit
@Composable
@RemoteComposable
RemoteTextButton(
    onClick: Action,
    modifier: RemoteModifier,
    colors: RemoteTextButtonColors,
    enabled: RemoteBoolean,
    border: RemoteDp?,
    borderColor: RemoteColor?,
    shape: RemoteShape,
    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: Action,
    modifier: RemoteModifier = RemoteModifier,
    colors: RemoteTextButtonColors = RemoteTextButtonDefaults.textButtonColors(),
    enabled: RemoteBoolean = true.rb,
    border: RemoteDp? = null,
    borderColor: RemoteColor? = null,
    shape: RemoteShape = RemoteTextButtonDefaults.shape,
    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 an RemoteTextButton with shape animation of rounded corners on press:

import androidx.compose.remote.core.operations.TextFromFloat
import androidx.compose.remote.creation.compose.action.ValueChange
import androidx.compose.remote.creation.compose.state.rememberMutableRemoteInt
import androidx.compose.remote.creation.compose.state.rs
import androidx.wear.compose.remote.material3.RemoteText
import androidx.wear.compose.remote.material3.RemoteTextButton

val tapCount = rememberMutableRemoteInt(0)
val text = "+".rs + tapCount.toRemoteString(3, TextFromFloat.PAD_PRE_NONE)

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

Will be called when the user clicks the button.

modifier: RemoteModifier = RemoteModifier

Modifier to be applied to the button.

colors: RemoteTextButtonColors = RemoteTextButtonDefaults.textButtonColors()

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

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.

border: RemoteDp? = null

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

borderColor: RemoteColor? = null

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

shape: RemoteShape = RemoteTextButtonDefaults.shape

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

content: @Composable @RemoteComposable () -> Unit

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