sealed interface RemoteModifier

Known direct subclasses
RemoteModifier.Companion

The RemoteModifier companion object is the empty, default, or starter RemoteModifier that contains no elements.


An ordered, immutable collection of modifier elements for Remote Compose.

RemoteModifier is the remote-first equivalent of androidx.compose.ui.Modifier. It is used to decorate or augment remote composables (e.g., adding padding, background, or click listeners).

Remote modifiers are designed to be encoded and evaluatable on a remote compose player.

Summary

Nested types

The RemoteModifier companion object is the empty, default, or starter RemoteModifier that contains no elements.

Public companion functions

open infix RemoteModifier

Concatenates this modifier with another.

open String

Public functions

open infix RemoteModifier

Concatenates this modifier with another.

Extension functions

RemoteModifier

Aligns this layout with sibling layouts in a Row by their shared baseline.

RemoteModifier

Draw content with modified alpha that may be less than 1.

RemoteModifier

Draws a solid color background behind the content.

RemoteModifier

Draws a remotePainter behind the content.

RemoteModifier
RemoteModifier.border(
    width: RemoteDp,
    color: RemoteColor,
    shape: RemoteShape
)

Draws a border around the element.

RemoteModifier
RemoteModifier.clickable(action: Action, enabled: Boolean, role: Role?)

Configure component to receive clicks via input or accessibility "click" event.

RemoteModifier
RemoteModifier

Creates a RemoteModifier that allows drawing with the component's content.

RemoteModifier

Sets the minimum and maximum height of the content.

RemoteModifier

Fills the maximum available height.

RemoteModifier

Fills the parent's maximum available height.

RemoteModifier

Sets the height of the content using RemoteDp.

RemoteModifier

Sets the height of the content using RemoteFloat.

RemoteModifier
RemoteModifier

Adds all padding to each edge of the content.

RemoteModifier

Adds all padding to each edge of the content.

RemoteModifier

Adds padding defined by the padding object.

RemoteModifier
RemoteModifier.padding(horizontal: RemoteDp, vertical: RemoteDp)

Adds horizontal padding to the start and end edges, and vertical padding to the top and bottom edges.

RemoteModifier
RemoteModifier.padding(horizontal: RemoteFloat, vertical: RemoteFloat)

Adds horizontal padding to the start and end edges, and vertical padding to the top and bottom edges.

RemoteModifier
RemoteModifier.padding(
    start: RemoteDp,
    top: RemoteDp,
    end: RemoteDp,
    bottom: RemoteDp
)

Adds padding to each edge of the content using RemoteDp values.

RemoteModifier
RemoteModifier.padding(
    start: RemoteFloat,
    top: RemoteFloat,
    end: RemoteFloat,
    bottom: RemoteFloat
)

Adds padding to each edge of the content.

RemoteModifier

Modifier to be applied to a RemoteButton to ensure that its size meets the recommended minimums.

RemoteModifier

Sets the degrees the view is rotated around the center of the composable.

RemoteModifier

Scale the contents of both the horizontal and vertical axis uniformly by the same scale factor.

RemoteModifier

Scale the contents of the composable by the following scale factors along the horizontal and vertical axis respectively.

RemoteModifier

Clears the semantics of all descendants and sets new semantics.

RemoteModifier
RemoteModifier.semantics(
    mergeDescendants: Boolean,
    properties: SemanticsPropertyReceiver.() -> Unit
)

Adds semantics to the node.

RemoteModifier

Fills the parent's maximum available width and height.

RemoteModifier

Sets both the width and height of the content to size.

RemoteModifier
RemoteModifier.size(width: RemoteDp, height: RemoteDp)

Sets the width and height of the content.

RemoteModifier

Wraps the content size to its intrinsic dimensions.

RemoteModifier
RemoteModifier
RemoteModifier
RemoteModifier
RemoteModifier
RemoteModifier

Sets the minimum and maximum width of the content.

RemoteModifier

Fills the maximum available width.

RemoteModifier

Fills the parent's maximum available width.

RemoteModifier

Sets the width of the content using RemoteDp.

RemoteModifier

Sets the width of the content using RemoteFloat.

RemoteModifier

Public companion functions

then

open infix fun then(other: RemoteModifier): RemoteModifier

Concatenates this modifier with another.

Returns a RemoteModifier representing this modifier followed by other in sequence.

toString

open fun toString(): String

Public functions

then

Added in 1.0.0-alpha11
open infix fun then(other: RemoteModifier): RemoteModifier

Concatenates this modifier with another.

Returns a RemoteModifier representing this modifier followed by other in sequence.

Extension functions

RemoteModifier.alignByBaseline

fun RemoteModifier.alignByBaseline(): RemoteModifier

Aligns this layout with sibling layouts in a Row by their shared baseline.

This modifier is used to align layouts within a Row based on their first baseline. It is particularly useful for aligning text-based elements to ensure their baselines match up, creating a visually consistent layout.

This is the remote equivalent of the Modifier.alignByBaseline() modifier in Jetpack Compose.

Example usage within a remote Row:

RemoteRow(
modifier = RemoteModifier.fillMaxWidth()
)
{
RemoteText(
text = "First",
modifier = RemoteModifier.alignByBaseline()
)
RemoteText(
text = "Second",
modifier = RemoteModifier.alignByBaseline()
)
}
fun RemoteModifier.alpha(alpha: RemoteFloat): RemoteModifier

Draw content with modified alpha that may be less than 1.

import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.alpha
import androidx.compose.remote.creation.compose.modifier.background
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rf
import androidx.compose.ui.graphics.Color

RemoteBox(RemoteModifier.size(100.rdp).alpha(0.5f.rf).background(Color.Red))
Parameters
alpha: RemoteFloat

the fraction of children's alpha value and must be between 0 and 1, inclusive.

See also
graphicsLayer

RemoteModifier.background

fun RemoteModifier.background(color: RemoteColor): RemoteModifier

Draws a solid color background behind the content.

Parameters
color: RemoteColor

The RemoteColor to use for the background.

RemoteModifier.background

fun RemoteModifier.background(remotePainter: RemotePainter): RemoteModifier

Draws a remotePainter behind the content.

Parameters
remotePainter: RemotePainter

The RemotePainter to use for the background.

fun RemoteModifier.border(
    width: RemoteDp,
    color: RemoteColor,
    shape: RemoteShape = RemoteRectangleShape
): RemoteModifier

Draws a border around the element.

Parameters
width: RemoteDp

The width of the border.

color: RemoteColor

The color of the border.

shape: RemoteShape = RemoteRectangleShape

The shape of the border. When RemoteRoundedCornerShape is used, only the RemoteRoundedCornerShape.topStart corner size is currently taken into consideration for all corners.

fun RemoteModifier.clickable(
    action: Action,
    enabled: Boolean = true,
    role: Role? = Role.Button
): RemoteModifier

Configure component to receive clicks via input or accessibility "click" event.

Add this modifier to the element to make it clickable within its bounds.

If you need to support double click or long click alongside the single click, consider using combinedClickable.

Parameters
action: Action

will be called when user clicks on the element

enabled: Boolean = true

Controls the enabled state. When false, action, and this modifier will appear disabled for accessibility services

role: Role? = Role.Button

the type of user interface element. Accessibility services might use this to describe the element or do customizations

fun RemoteModifier.clip(shape: RemoteShape = RemoteRectangleShape): RemoteModifier

RemoteModifier.drawWithContent

fun RemoteModifier.drawWithContent(onDraw: RemoteContentDrawScope.() -> Unit): RemoteModifier

Creates a RemoteModifier that allows drawing with the component's content.

Parameters
onDraw: RemoteContentDrawScope.() -> Unit

The drawing block that provides access to RemoteContentDrawScope.

fun RemoteModifier.heightIn(min: RemoteDp? = null, max: RemoteDp? = null): RemoteModifier

Sets the minimum and maximum height of the content.

Parameters
min: RemoteDp? = null

The minimum height.

max: RemoteDp? = null

The maximum height.

RemoteModifier.fillMaxHeight

fun RemoteModifier.fillMaxHeight(fraction: RemoteFloat = 1f.rf): RemoteModifier

Fills the maximum available height.

Parameters
fraction: RemoteFloat = 1f.rf

The fraction of the maximum height to use.

RemoteModifier.fillParentMaxHeight

fun RemoteModifier.fillParentMaxHeight(fraction: RemoteFloat = 1f.rf): RemoteModifier

Fills the parent's maximum available height.

Parameters
fraction: RemoteFloat = 1f.rf

The fraction of the parent's maximum height to use.

fun RemoteModifier.height(height: RemoteDp): RemoteModifier

Sets the height of the content using RemoteDp.

fun RemoteModifier.height(height: RemoteFloat): RemoteModifier

Sets the height of the content using RemoteFloat.

fun RemoteModifier.padding(all: RemoteDp): RemoteModifier

Adds all padding to each edge of the content.

fun RemoteModifier.padding(all: RemoteFloat): RemoteModifier

Adds all padding to each edge of the content.

fun RemoteModifier.padding(padding: RemotePaddingValues): RemoteModifier

Adds padding defined by the padding object.

fun RemoteModifier.padding(
    horizontal: RemoteDp = 0.rdp,
    vertical: RemoteDp = 0.rdp
): RemoteModifier

Adds horizontal padding to the start and end edges, and vertical padding to the top and bottom edges.

fun RemoteModifier.padding(
    horizontal: RemoteFloat = 0f.rf,
    vertical: RemoteFloat = 0f.rf
): RemoteModifier

Adds horizontal padding to the start and end edges, and vertical padding to the top and bottom edges.

fun RemoteModifier.padding(
    start: RemoteDp = 0.rdp,
    top: RemoteDp = 0.rdp,
    end: RemoteDp = 0.rdp,
    bottom: RemoteDp = 0.rdp
): RemoteModifier

Adds padding to each edge of the content using RemoteDp values.

Parameters
start: RemoteDp = 0.rdp

Padding at the start edge.

top: RemoteDp = 0.rdp

Padding at the top edge.

end: RemoteDp = 0.rdp

Padding at the end edge.

bottom: RemoteDp = 0.rdp

Padding at the bottom edge.

fun RemoteModifier.padding(
    start: RemoteFloat = 0f.rf,
    top: RemoteFloat = 0f.rf,
    end: RemoteFloat = 0f.rf,
    bottom: RemoteFloat = 0f.rf
): RemoteModifier

Adds padding to each edge of the content.

Parameters
start: RemoteFloat = 0f.rf

Padding at the start edge.

top: RemoteFloat = 0f.rf

Padding at the top edge.

end: RemoteFloat = 0f.rf

Padding at the end edge.

bottom: RemoteFloat = 0f.rf

Padding at the bottom edge.

RemoteModifier.buttonSizeModifier

fun RemoteModifier.buttonSizeModifier(): RemoteModifier

Modifier to be applied to a RemoteButton to ensure that its size meets the recommended minimums.

fun RemoteModifier.rotate(degrees: RemoteFloat): RemoteModifier

Sets the degrees the view is rotated around the center of the composable. Increasing values result in clockwise rotation. Negative degrees are used to rotate in the counter clockwise direction

import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.background
import androidx.compose.remote.creation.compose.modifier.rotate
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rf
import androidx.compose.ui.graphics.Color

RemoteBox(RemoteModifier.rotate(45f.rf).size(100.rdp, 100.rdp).background(Color.Red))
Parameters
degrees: RemoteFloat

Degrees to rotate the content.

See also
graphicsLayer
fun RemoteModifier.scale(scale: RemoteFloat): RemoteModifier

Scale the contents of both the horizontal and vertical axis uniformly by the same scale factor.

import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.background
import androidx.compose.remote.creation.compose.modifier.scale
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rf
import androidx.compose.ui.graphics.Color

RemoteBox(RemoteModifier.scale(2f.rf).size(100.rdp, 100.rdp).background(Color.Red))
Parameters
scale: RemoteFloat

Multiplier to scale content along the horizontal and vertical axis

See also
graphicsLayer
fun RemoteModifier.scale(scaleX: RemoteFloat, scaleY: RemoteFloat): RemoteModifier

Scale the contents of the composable by the following scale factors along the horizontal and vertical axis respectively. Negative scale factors can be used to mirror content across the corresponding horizontal or vertical axis.

import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.background
import androidx.compose.remote.creation.compose.modifier.scale
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rf
import androidx.compose.ui.graphics.Color

RemoteBox(RemoteModifier.scale(2f.rf, 3f.rf).size(100.rdp, 100.rdp).background(Color.Red))
Parameters
scaleX: RemoteFloat

Multiplier to scale content along the horizontal axis

scaleY: RemoteFloat

Multiplier to scale content along the vertical axis

See also
graphicsLayer

RemoteModifier.clearAndSetSemantics

fun RemoteModifier.clearAndSetSemantics(properties: SemanticsPropertyReceiver.() -> Unit): RemoteModifier

Clears the semantics of all descendants and sets new semantics.

Parameters
properties: SemanticsPropertyReceiver.() -> Unit

A lambda to configure the semantics.

fun RemoteModifier.semantics(
    mergeDescendants: Boolean = false,
    properties: SemanticsPropertyReceiver.() -> Unit
): RemoteModifier

Adds semantics to the node.

Parameters
mergeDescendants: Boolean = false

Whether to merge the semantics of all descendants into this node.

properties: SemanticsPropertyReceiver.() -> Unit

A lambda to configure the semantics.

RemoteModifier.fillMaxSize

fun RemoteModifier.fillMaxSize(fraction: RemoteFloat = 1f.rf): RemoteModifier

Fills the parent's maximum available width and height.

Parameters
fraction: RemoteFloat = 1f.rf

The fraction of the parent's maximum size to use.

fun RemoteModifier.size(size: RemoteDp): RemoteModifier

Sets both the width and height of the content to size.

fun RemoteModifier.size(width: RemoteDp, height: RemoteDp): RemoteModifier

Sets the width and height of the content.

Parameters
width: RemoteDp

The width to apply.

height: RemoteDp

The height to apply.

RemoteModifier.wrapContentSize

fun RemoteModifier.wrapContentSize(): RemoteModifier

Wraps the content size to its intrinsic dimensions.

RemoteModifier.onTouchCancel

fun RemoteModifier.onTouchCancel(vararg actions: Action): RemoteModifier
fun RemoteModifier.widthIn(min: RemoteDp? = null, max: RemoteDp? = null): RemoteModifier

Sets the minimum and maximum width of the content.

Parameters
min: RemoteDp? = null

The minimum width.

max: RemoteDp? = null

The maximum width.

RemoteModifier.fillMaxWidth

fun RemoteModifier.fillMaxWidth(fraction: RemoteFloat = RemoteFloat(1f)): RemoteModifier

Fills the maximum available width.

Parameters
fraction: RemoteFloat = RemoteFloat(1f)

The fraction of the maximum width to use.

RemoteModifier.fillParentMaxWidth

fun RemoteModifier.fillParentMaxWidth(fraction: RemoteFloat = 1f.rf): RemoteModifier

Fills the parent's maximum available width.

Parameters
fraction: RemoteFloat = 1f.rf

The fraction of the parent's maximum width to use.

fun RemoteModifier.width(width: RemoteDp): RemoteModifier

Sets the width of the content using RemoteDp.

fun RemoteModifier.width(width: RemoteFloat): RemoteModifier

Sets the width of the content using RemoteFloat.