androidx.compose.remote.creation.compose.modifier

Interfaces

GraphicsLayerScope

Scope for configuring graphics layer properties in a type-safe builder lambda.

RemoteModifier

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

SemanticsPropertyReceiver

SemanticsPropertyReceiver is the scope provided by semantics {} blocks, letting you set key/value pairs primarily via extension functions.

Classes

RemoteEnterTransition

Transition effect applied when a component enters a state layout.

RemoteExitTransition

Transition effect applied when a component exits a state layout.

RemoteScrollState

State object for controlling and observing scroll position in Remote Compose layouts.

RenderEffect
SemanticsPropertyKey

SemanticsPropertyKey is the infrastructure for setting key/value pairs inside semantics block in a type-safe way.

Objects

RemoteModifier.Companion

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

SemanticsProperties

General semantics properties, mainly used for accessibility and testing.

Composables

rememberRemoteScrollState

Creates and remembers a RemoteScrollState.

Top-level functions summary

RemoteEnterTransition

Creates a fade-in enter transition for Remote Compose state layouts.

RemoteExitTransition

Creates a fade-out exit transition for Remote Compose state layouts.

Extension functions summary

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

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.animationSpec(
    animationId: Int,
    motionDuration: Float,
    motionEasingType: Int,
    visibilityDuration: Float,
    visibilityEasingType: Int,
    enterAnimation: AnimationSpec.ANIMATION,
    exitAnimation: AnimationSpec.ANIMATION,
    enabled: Boolean
)

This function is deprecated. Use sharedElement, animateEnterExit, or animationSpec taking RemoteAnimationSpec instead

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

Clears the semantics of all descendants and sets new semantics.

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

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

RemoteModifier
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

Fills the maximum available height.

RemoteModifier

Fills the parent's maximum available width and height.

RemoteModifier

Fills the maximum available width.

RemoteModifier

Fills the parent's maximum available height.

RemoteModifier

Fills the parent's maximum available width.

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 height of the content using RemoteDp.

RemoteModifier

Sets the height of the content using RemoteFloat.

RemoteModifier

Sets the minimum and maximum height of the content.

RemoteModifier

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

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

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
RemoteModifier.semantics(
    mergeDescendants: Boolean,
    properties: SemanticsPropertyReceiver.() -> Unit
)

Adds semantics to the node.

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

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

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

RemoteModifier
RemoteModifier

Sets the width of the content using RemoteDp.

RemoteModifier

Sets the width of the content using RemoteFloat.

RemoteModifier

Sets the minimum and maximum width 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

Extension properties summary

RemoteString?

Developer-set content description of the semantics node, for use in testing, accessibility and similar use cases.

Boolean

Whether the component is enabled.

Role?

The type of user interface element.

RemoteString?

Description of the state for the semantics node.

RemoteString?

Text content for the semantics node.

Top-level functions

fun remoteFadeIn(): RemoteEnterTransition

Creates a fade-in enter transition for Remote Compose state layouts.

fun remoteFadeOut(): RemoteExitTransition

Creates a fade-out exit transition for Remote Compose state layouts.

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.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()
): 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)

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

fun RemoteModifier.animationSpec(
    animationId: Int = -1,
    motionDuration: Float = 300.0f,
    motionEasingType: Int = GeneralEasing.CUBIC_STANDARD,
    visibilityDuration: Float = motionDuration,
    visibilityEasingType: Int = motionEasingType,
    enterAnimation: AnimationSpec.ANIMATION = ANIMATION.FADE_IN,
    exitAnimation: AnimationSpec.ANIMATION = ANIMATION.FADE_OUT,
    enabled: Boolean = true
): RemoteModifier

Applies an animation specification to a component using explicit durations and easing types.

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.

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.

RemoteModifier.clickable

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

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

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.

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

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.

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

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

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.

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

Extension properties

SemanticsPropertyReceiver.contentDescription

var SemanticsPropertyReceiver.contentDescription: RemoteString?

Developer-set content description of the semantics node, for use in testing, accessibility and similar use cases.

SemanticsPropertyReceiver.enabled

var SemanticsPropertyReceiver.enabled: Boolean

Whether the component is enabled.

SemanticsPropertyReceiver.role

var SemanticsPropertyReceiver.role: Role?

The type of user interface element. Accessibility services can use this to describe the node.

SemanticsPropertyReceiver.stateDescription

var SemanticsPropertyReceiver.stateDescription: RemoteString?

Description of the state for the semantics node.

SemanticsPropertyReceiver.text

var SemanticsPropertyReceiver.text: RemoteString?

Text content for the semantics node.