← Back to Foundation Layout
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.
fun Modifier.offset(x: Dp = 0.dp, y: Dp = 0.dp)
fun Modifier.offset(offset: Density.() -> IntOffset)