androidx.compose.foundation.layout

offset

Function · from org.jetbrains.compose.foundation:foundation-layout:1.12.2

No hand-written docs yet.

Offset the content by (x dp, y dp). The offsets can be positive as well as non-positive. Applying an offset only changes the position of the content, without interfering with its size measurement.

With x, y

fun Modifier.offset(
    x: Dp = 0.dp,
    y: Dp = 0.dp,
)

x: DpOptional

Default: 0.dp

Not described.

y: DpOptional

Default: 0.dp

Not described.

With offset

fun Modifier.offset(offset: Density.() -> IntOffset)

offset: Density.() -> IntOffsetRequired

Not described.

Library docs

Offset the content by (x dp, y dp). The offsets can be positive as well as non-positive. Applying an offset only changes the position of the content, without interfering with its size measurement.

This modifier will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. For a modifier that offsets without considering layout direction, see absoluteOffset.

Example usage: