---
title: "translation"
description: "Translates (moves) the component horizontally and vertically."
type: "function"
lastmod: "2026-05-20T01:13:53.261742Z"
---
## API Reference

### translation

> Source set: Common

```kotlin
@ExperimentalFoundationStyleApi
fun TranslationScope.translation(
    @FloatRange(from = 0.0) x: Float,
    @FloatRange(from = 0.0) y: Float,
)
```

Translates (moves) the component horizontally and vertically.

This property is *not* inherited

#### Parameters

| | |
| --- | --- |
| x | The translation amount on the X-axis in pixels. |
| y | The translation amount on the Y-axis in pixels. |

### translation

> Source set: Common

```kotlin
@ExperimentalFoundationStyleApi
fun TranslationScope.translation(offset: Offset)
```

Translates (moves) the component by the given [Offset](/jetpack-compose/androidx.compose.ui/ui-geometry/functions/Offset).

This property is *not* inherited

#### Parameters

| | |
| --- | --- |
| offset | The translation offset in pixels. |
