Function

graphicsLayer

Applies visual effects such as scaling, rotation, translation, shadow, alpha, or clipping to content.

graphicsLayer

Source set: JvmAndAndroid
public 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: RemoteShape = RemoteRectangleShape,
    compositingStrategy: RemoteCompositingStrategy = RemoteCompositingStrategy.Auto,
    cameraDistance: RemoteFloat = 8f.rf, // Default Value for Camera Distance
    renderEffect: RemoteRenderEffect? = null,
): RemoteModifier

Applies visual effects such as scaling, rotation, translation, shadow, alpha, or clipping to content.

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

Note: Graphics layer clipping only supports a uniform corner radius. If an asymmetric RemoteRoundedCornerShape is provided, RemoteRoundedCornerShape.topStart is used for all corners.

Parameters

scaleX horizontal scale factor
scaleY vertical scale factor
rotationX rotation of the layer around the X axis in degrees
rotationY rotation of the layer around the Y axis in degrees
rotationZ rotation of the layer around the Z axis in degrees
shadowElevation shadow elevation of the layer
transformOriginX horizontal center of the transform, as a fraction of the layer width
transformOriginY vertical center of the transform, as a fraction of the layer height
translationX horizontal translation of the layer
translationY vertical translation of the layer
alpha alpha (opacity) of the layer
shape RemoteShape of the layer
compositingStrategy RemoteCompositingStrategy to use for the layer
cameraDistance camera distance for 3D transforms
renderEffect RemoteRenderEffect to apply, or null

Return

a RemoteModifier that applies the graphics layer effects

graphicsLayer

Source set: JvmAndAndroid
public fun RemoteModifier.graphicsLayer(
    block: RemoteGraphicsLayerScope.() -> Unit
): RemoteModifier

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

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

Example usage:

modifier.graphicsLayer {
alpha = 0.5f.rf
rotationZ = 45f.rf
}

Parameters

block The lambda block to configure the RemoteGraphicsLayerScope.

Return

a RemoteModifier that applies the graphics layer configured by block

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: