Compose Unstyled 2.0 is out! Check the official announcement blog ->
Interface

TranslationScope

An interface that introduces the translation properties to a Style receiver scope.

Source set: Common
@ExperimentalFoundationStyleApi
interface TranslationScope

An interface that introduces the translation properties to a Style receiver scope.

Functions

translationX

fun translationX(@FloatRange(from = 0.0) value: Float)

Translates (moves) the component horizontally. Positive values move it to the right, negative values to the left.

This property is not inherited

Parameters

value The translation amount on the X-axis in pixels.

translationY

fun translationY(@FloatRange(from = 0.0) value: Float)

Translates (moves) the component vertically. Positive values move it down, negative values up.

This property is not inherited

Parameters

value The translation amount on the Y-axis in pixels.

Last updated: