---
title: "TransformableState"
description: "Default implementation of [TransformableState] interface that contains necessary information
about the ongoing transformations and provides smooth transformation capabilities.

This is the simplest way to set up a [transformable] modifier. When constructing this
[TransformableState], you must provide a [onTransformation] lambda, which will be invoked
whenever pan, zoom or rotation happens (by gesture input or any [TransformableState.transform]
call) with the deltas from the previous event."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


> **Deprecated** Prefer creating TransformableState with a onTransformation lambda that takes the centroid. This centroid (if specified) is the point at which zooming or rotation should happen around which allows for more natural transformations.

```kotlin
fun TransformableState(
    onTransformation: (zoomChange: Float, panChange: Offset, rotationChange: Float) -> Unit
): TransformableState
```


Default implementation of `TransformableState` interface that contains necessary information
about the ongoing transformations and provides smooth transformation capabilities.

This is the simplest way to set up a `transformable` modifier. When constructing this
`TransformableState`, you must provide a `onTransformation` lambda, which will be invoked
whenever pan, zoom or rotation happens (by gesture input or any `TransformableState.transform`
call) with the deltas from the previous event.

#### Parameters

| | |
| --- | --- |
| onTransformation | callback invoked when transformation occurs. The callback receives the change from the previous event. It's relative scale multiplier for zoom, `Offset` in pixels for pan and degrees for rotation. Callers should update their state in this lambda. |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun TransformableState(
    onTransformation:
        (centroid: Offset, zoomChange: Float, panChange: Offset, rotationChange: Float) -> Unit
): TransformableState
```


Default implementation of `TransformableState` interface that contains necessary information
about the ongoing transformations and provides smooth transformation capabilities.

This is the simplest way to set up a `transformable` modifier. When constructing this
`TransformableState`, you must provide a `onTransformation` lambda, which will be invoked
whenever pan, zoom or rotation happens (by gesture input or any `TransformableState.transform`
call) with the deltas from the previous event.

#### Parameters

| | |
| --- | --- |
| onTransformation | callback invoked when transformation occurs. The callback receives the change from the previous event. The centroid `Offset` refers to where the transformation occurs. The changes are a relative scale multiplier for zoom, `Offset` in pixels for pan and degrees for rotation. Callers should update their state in this lambda. |




