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
RemoteModifier.animateEnterExit(
    enter: RemoteEnterTransition,
    exit: RemoteExitTransition,
    spec: RemoteTweenSpec,
    animationId: Int
)

Applies enter and exit visibility transitions to a component in a state layout.

RemoteModifier

Enables or disables animation transitions for this component.

RemoteModifier
RemoteModifier.animationSpec(animationId: Int, enabled: Boolean)

Applies an animation specification to match elements for shared transitions across states.

RemoteModifier
RemoteModifier.animationSpec(
    animationId: Int,
    motionSpec: RemoteTweenSpec,
    visibilitySpec: RemoteTweenSpec,
    enter: RemoteEnterTransition,
    exit: RemoteExitTransition
)

Applies an animation specification for shared bounds and visibility transitions to a component.

RemoteModifier
RemoteModifier.sharedBounds(
    key: Int,
    spec: RemoteTweenSpec,
    enter: RemoteEnterTransition,
    exit: RemoteExitTransition
)

Marks this component as a shared bounds container that smoothly transitions its bounds, position, and styling between states in a state layout.

RemoteModifier
RemoteModifier.sharedElement(
    key: Int,
    spec: RemoteTweenSpec,
    enter: RemoteEnterTransition,
    exit: RemoteExitTransition
)

Marks this component as a shared element that smoothly transitions its bounds, position, and styling between states in a state layout.

RemoteModifier

Draws a solid color background behind the content.

RemoteModifier

Draws a painter behind the content.

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

Draws a border around the element.

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

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

RemoteModifier

Clips the content to shape.

RemoteModifier
RemoteModifier.defaultMinSize(minWidth: RemoteDp?, minHeight: RemoteDp?)

Constrain the size of the wrapped layout only when it would be otherwise unconstrained: the minWidth and minHeight constraints are only applied when the corresponding dimension has not been constrained by another modifier (e.g. width, height, size, or fillMaxWidth).

RemoteModifier

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

RemoteModifier

Applies a graphics layer modifier to the RemoteModifier using a type-safe builder lambda.

RemoteModifier
RemoteModifier.graphicsLayer(
    scaleX: RemoteFloat,
    scaleY: RemoteFloat,
    rotationX: RemoteFloat,
    rotationY: RemoteFloat,
    rotationZ: RemoteFloat,
    shadowElevation: RemoteFloat,
    transformOriginX: RemoteFloat,
    transformOriginY: RemoteFloat,
    translationX: RemoteFloat,
    translationY: RemoteFloat,
    alpha: RemoteFloat,
    shape: Shape,
    compositingStrategy: CompositingStrategy,
    cameraDistance: RemoteFloat,
    renderEffect: RenderEffect?
)

Applies a graphics layer modifier to the RemoteModifier.

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

Offsets the content by (x, y).

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 paddingValues 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

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

Modify element to allow it to scroll horizontally when its content is larger than its constraints.

RemoteModifier

Modify element to allow it to scroll vertically when its content is larger than its constraints.

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 height to its intrinsic dimensions.

RemoteModifier

Wraps the content size to its intrinsic dimensions.

RemoteModifier

Wraps the content width to its intrinsic dimensions.

RemoteModifier

Performs action when a touch gesture is cancelled on the element.

RemoteModifier

Performs action when a touch down event occurs on the element.

RemoteModifier

Performs action when a touch up event occurs on the element.

RemoteModifier

Sets the visibility of the element.

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

Controls the drawing order of the element relative to its siblings with zIndex.

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.

Parameters
other: RemoteModifier

The RemoteModifier to append after this modifier.

toString

open fun toString(): String

Public functions

then

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

Concatenates this modifier with another.

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

Parameters
other: RemoteModifier

The RemoteModifier to append after this modifier.

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".rs,
modifier = RemoteModifier.alignByBaseline()
)
RemoteText(
text = "Second".rs,
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.rc
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.rc))
Parameters
alpha: RemoteFloat

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

See also
graphicsLayer

RemoteModifier.animateEnterExit

fun RemoteModifier.animateEnterExit(
    enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn,
    exit: RemoteExitTransition = RemoteExitTransition.FadeOut,
    spec: RemoteTweenSpec = remoteTween(),
    animationId: Int = -1
): RemoteModifier

Applies enter and exit visibility transitions to a component in a state layout.

Parameters
enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn

transition effect when component enters the layout

exit: RemoteExitTransition = RemoteExitTransition.FadeOut

transition effect when component exits the layout

spec: RemoteTweenSpec = remoteTween()

animation specification for visibility transitions (e.g. remoteTween)

animationId: Int = -1

non-zero identifier for the animation (-1 for default non-shared transition)

RemoteModifier.animationSpec

fun RemoteModifier.animationSpec(enabled: Boolean): RemoteModifier

Enables or disables animation transitions for this component.

Parameters
enabled: Boolean

whether animation transitions are enabled for this component

RemoteModifier.animationSpec

fun RemoteModifier.animationSpec(animationId: Int, enabled: Boolean): RemoteModifier

Applies an animation specification to match elements for shared transitions across states.

Parameters
animationId: Int

identifier used to match elements for shared transitions

enabled: Boolean

whether animation transitions are enabled for this component

RemoteModifier.animationSpec

fun RemoteModifier.animationSpec(
    animationId: Int = -1,
    motionSpec: RemoteTweenSpec = remoteTween(),
    visibilitySpec: RemoteTweenSpec = motionSpec,
    enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn,
    exit: RemoteExitTransition = RemoteExitTransition.FadeOut
): RemoteModifier

Applies an animation specification for shared bounds and visibility transitions to a component.

Parameters
animationId: Int = -1

identifier used to match elements for shared transitions (-1 for auto)

motionSpec: RemoteTweenSpec = remoteTween()

animation specification for motion/bounds transitions (e.g. remoteTween)

visibilitySpec: RemoteTweenSpec = motionSpec

animation specification for enter/exit visibility transitions

enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn

transition effect when component enters the layout

exit: RemoteExitTransition = RemoteExitTransition.FadeOut

transition effect when component exits the layout

RemoteModifier.sharedBounds

fun RemoteModifier.sharedBounds(
    key: Int,
    spec: RemoteTweenSpec = remoteTween(),
    enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn,
    exit: RemoteExitTransition = RemoteExitTransition.FadeOut
): RemoteModifier

Marks this component as a shared bounds container that smoothly transitions its bounds, position, and styling between states in a state layout.

Parameters
key: Int

unique non-zero integer identifier matching this container across states

spec: RemoteTweenSpec = remoteTween()

animation specification for bounds and transforms (e.g. remoteTween)

enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn

transition effect when component enters the layout

exit: RemoteExitTransition = RemoteExitTransition.FadeOut

transition effect when component exits the layout

RemoteModifier.sharedElement

fun RemoteModifier.sharedElement(
    key: Int,
    spec: RemoteTweenSpec = remoteTween(),
    enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn,
    exit: RemoteExitTransition = RemoteExitTransition.FadeOut
): RemoteModifier

Marks this component as a shared element that smoothly transitions its bounds, position, and styling between states in a state layout.

Parameters
key: Int

unique non-zero integer identifier matching this element across states

spec: RemoteTweenSpec = remoteTween()

animation specification for bounds and transforms (e.g. remoteTween)

enter: RemoteEnterTransition = RemoteEnterTransition.FadeIn

transition effect when component enters the layout

exit: RemoteExitTransition = RemoteExitTransition.FadeOut

transition effect when component exits the layout

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(painter: RemotePainter): RemoteModifier

Draws a painter behind the content.

Parameters
painter: 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: RemoteAction,
    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: RemoteAction

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

Clips the content to shape.

Parameters
shape: RemoteShape = RemoteRectangleShape

The RemoteShape to clip the content to.

RemoteModifier.defaultMinSize

fun RemoteModifier.defaultMinSize(
    minWidth: RemoteDp? = null,
    minHeight: RemoteDp? = null
): RemoteModifier

Constrain the size of the wrapped layout only when it would be otherwise unconstrained: the minWidth and minHeight constraints are only applied when the corresponding dimension has not been constrained by another modifier (e.g. width, height, size, or fillMaxWidth).

Parameters
minWidth: RemoteDp? = null

The minimum width to be used if width is otherwise unconstrained.

minHeight: RemoteDp? = null

The minimum height to be used if height is otherwise unconstrained.

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.

RemoteModifier.graphicsLayer

fun RemoteModifier.graphicsLayer(block: GraphicsLayerScope.() -> Unit): RemoteModifier

Applies a graphics layer modifier to the RemoteModifier using a type-safe builder lambda.

This overload allows configuring layer properties within a GraphicsLayerScope block, which is similar to standard Compose's graphicsLayer { ... }.

Example usage:

modifier.graphicsLayer {
alpha = 0.5f.rf
rotationZ = 45f.rf
}
Parameters
block: GraphicsLayerScope.() -> Unit

The lambda block to configure the GraphicsLayerScope.

RemoteModifier.graphicsLayer

fun RemoteModifier.graphicsLayer(
    scaleX: RemoteFloat = 1f.rf,
    scaleY: RemoteFloat = 1f.rf,
    rotationX: RemoteFloat = 0f.rf,
    rotationY: RemoteFloat = 0f.rf,
    rotationZ: RemoteFloat = 0f.rf,
    shadowElevation: RemoteFloat = 0f.rf,
    transformOriginX: RemoteFloat = 0.5f.rf,
    transformOriginY: RemoteFloat = 0.5f.rf,
    translationX: RemoteFloat = 0f.rf,
    translationY: RemoteFloat = 0f.rf,
    alpha: RemoteFloat = 1f.rf,
    shape: Shape = RectangleShape,
    compositingStrategy: CompositingStrategy = Auto,
    cameraDistance: RemoteFloat = 8f.rf,
    renderEffect: RenderEffect? = null
): RemoteModifier

Applies a graphics layer modifier to the RemoteModifier.

A graphics layer modifier can be used to apply effects such as scaling, rotation, translation, shadow, clipping, alpha, and render effects (like blur) to the drawing content.

This overload accepts RemoteFloat values, which allow binding properties to dynamic expressions or state.

Parameters
scaleX: RemoteFloat = 1f.rf

The horizontal scale factor.

scaleY: RemoteFloat = 1f.rf

The vertical scale factor.

rotationX: RemoteFloat = 0f.rf

The rotation of the layer around the X axis, in degrees.

rotationY: RemoteFloat = 0f.rf

The rotation of the layer around the Y axis, in degrees.

rotationZ: RemoteFloat = 0f.rf

The rotation of the layer around the Z axis, in degrees.

shadowElevation: RemoteFloat = 0f.rf

The shadow elevation of the layer.

transformOriginX: RemoteFloat = 0.5f.rf

The horizontal center of the transform, as a fraction of the layer width.

transformOriginY: RemoteFloat = 0.5f.rf

The vertical center of the transform, as a fraction of the layer height.

translationX: RemoteFloat = 0f.rf

The horizontal translation of the layer.

translationY: RemoteFloat = 0f.rf

The vertical translation of the layer.

alpha: RemoteFloat = 1f.rf

The alpha (opacity) of the layer.

shape: Shape = RectangleShape

The shape of the layer.

compositingStrategy: CompositingStrategy = Auto

The compositing strategy to use for the layer.

cameraDistance: RemoteFloat = 8f.rf

The camera distance for 3D transforms.

renderEffect: RenderEffect? = null

The RenderEffect to apply, or null.

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.

Parameters
height: RemoteDp

The height to apply in RemoteDp.

fun RemoteModifier.height(height: RemoteFloat): RemoteModifier

Sets the height of the content using RemoteFloat.

Parameters
height: RemoteFloat

The height to apply in pixels.

fun RemoteModifier.offset(x: RemoteDp = 0.rdp, y: RemoteDp = 0.rdp): RemoteModifier

Offsets the content by (x, y).

Parameters
x: RemoteDp = 0.rdp

The horizontal offset in RemoteDp.

y: RemoteDp = 0.rdp

The vertical offset in RemoteDp.

fun RemoteModifier.padding(all: RemoteDp): RemoteModifier

Adds all padding to each edge of the content.

Parameters
all: RemoteDp

Padding in RemoteDp applied to all four edges.

fun RemoteModifier.padding(all: RemoteFloat): RemoteModifier

Adds all padding to each edge of the content.

Parameters
all: RemoteFloat

Padding in pixels applied to all four edges.

fun RemoteModifier.padding(paddingValues: RemotePaddingValues): RemoteModifier

Adds padding defined by the paddingValues object.

Parameters
paddingValues: RemotePaddingValues

The RemotePaddingValues describing the padding for each edge.

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.

Parameters
horizontal: RemoteDp = 0.rdp

Padding in RemoteDp applied to the start and end edges.

vertical: RemoteDp = 0.rdp

Padding in RemoteDp applied 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.

Parameters
horizontal: RemoteFloat = 0f.rf

Padding in pixels applied to the start and end edges.

vertical: RemoteFloat = 0f.rf

Padding in pixels applied 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.

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.rc
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.rc))
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.rc
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.rc))
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.rc
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.rc))
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.horizontalScroll

fun RemoteModifier.horizontalScroll(state: RemoteScrollState): RemoteModifier

Modify element to allow it to scroll horizontally when its content is larger than its constraints.

import androidx.compose.remote.creation.compose.layout.RemoteAlignment
import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.layout.RemoteRow
import androidx.compose.remote.creation.compose.layout.RemoteText
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.RemoteScrollState
import androidx.compose.remote.creation.compose.modifier.background
import androidx.compose.remote.creation.compose.modifier.horizontalScroll
import androidx.compose.remote.creation.compose.modifier.padding
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.state.rc
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color

val scrollState = remember { RemoteScrollState() }
RemoteRow(
    modifier =
        RemoteModifier.size(200.rdp, 100.rdp)
            .background(Color.LightGray.rc)
            .horizontalScroll(scrollState),
    verticalAlignment = RemoteAlignment.CenterVertically,
) {
    for (i in 1..10) {
        RemoteBox(
            modifier =
                RemoteModifier.size(80.rdp, 80.rdp).padding(5.rdp).background(Color.Red.rc),
            contentAlignment = RemoteAlignment.Center,
        ) {
            RemoteText("Item $i".rs, color = Color.White.rc)
        }
    }
}
Parameters
state: RemoteScrollState

The RemoteScrollState that tracks and controls the scroll position. It can be created and remembered using rememberRemoteScrollState.

Returns
RemoteModifier

The modified RemoteModifier.

RemoteModifier.verticalScroll

fun RemoteModifier.verticalScroll(state: RemoteScrollState): RemoteModifier

Modify element to allow it to scroll vertically when its content is larger than its constraints.

import androidx.compose.remote.creation.compose.layout.RemoteAlignment
import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.layout.RemoteColumn
import androidx.compose.remote.creation.compose.layout.RemoteText
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.RemoteScrollState
import androidx.compose.remote.creation.compose.modifier.background
import androidx.compose.remote.creation.compose.modifier.padding
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.modifier.verticalScroll
import androidx.compose.remote.creation.compose.state.rc
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color

val scrollState = remember { RemoteScrollState() }
RemoteColumn(
    modifier =
        RemoteModifier.size(200.rdp).background(Color.LightGray.rc).verticalScroll(scrollState)
) {
    for (i in 1..10) {
        RemoteBox(
            modifier =
                RemoteModifier.size(180.rdp, 50.rdp).padding(5.rdp).background(Color.Red.rc),
            contentAlignment = RemoteAlignment.Center,
        ) {
            RemoteText("Item $i".rs, color = Color.White.rc)
        }
    }
}
Parameters
state: RemoteScrollState

The RemoteScrollState that tracks and controls the scroll position. It can be created and remembered using rememberRemoteScrollState.

Returns
RemoteModifier

The modified RemoteModifier.

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.

Parameters
size: RemoteDp

The width and height to apply in RemoteDp.

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.wrapContentHeight

fun RemoteModifier.wrapContentHeight(): RemoteModifier

Wraps the content height to its intrinsic dimensions.

RemoteModifier.wrapContentSize

fun RemoteModifier.wrapContentSize(): RemoteModifier

Wraps the content size to its intrinsic dimensions.

RemoteModifier.wrapContentWidth

fun RemoteModifier.wrapContentWidth(): RemoteModifier

Wraps the content width to its intrinsic dimensions.

RemoteModifier.onTouchCancel

fun RemoteModifier.onTouchCancel(action: RemoteAction): RemoteModifier

Performs action when a touch gesture is cancelled on the element.

Parameters
action: RemoteAction

The RemoteAction to perform when the touch is cancelled.

RemoteModifier.onTouchDown

fun RemoteModifier.onTouchDown(action: RemoteAction): RemoteModifier

Performs action when a touch down event occurs on the element.

Parameters
action: RemoteAction

The RemoteAction to perform on touch down.

fun RemoteModifier.onTouchUp(action: RemoteAction): RemoteModifier

Performs action when a touch up event occurs on the element.

Parameters
action: RemoteAction

The RemoteAction to perform on touch up.

RemoteModifier.visibility

fun RemoteModifier.visibility(visible: RemoteInt): RemoteModifier

Sets the visibility of the element.

Parameters
visible: RemoteInt

A RemoteInt indicating visibility (Component.Visibility.VISIBLE, INVISIBLE, or GONE).

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.

Parameters
width: RemoteDp

The width to apply in RemoteDp.

fun RemoteModifier.width(width: RemoteFloat): RemoteModifier

Sets the width of the content using RemoteFloat.

Parameters
width: RemoteFloat

The width to apply in pixels.

fun RemoteModifier.zIndex(zIndex: RemoteFloat): RemoteModifier

Controls the drawing order of the element relative to its siblings with zIndex.

Parameters
zIndex: RemoteFloat

The z-index value; higher values are drawn on top of lower values.