---
title: "OnRemeasuredModifier"
description: "A modifier whose [onRemeasured] is called when the layout content is remeasured. The most common
usage is [onSizeChanged]."
type: "interface"
---

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


<a id='references'></a>

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



```kotlin
@JvmDefaultWithCompatibility
interface OnRemeasuredModifier : Modifier.Element
```


A modifier whose `onRemeasured` is called when the layout content is remeasured. The most common
usage is `onSizeChanged`.


## Functions

```kotlin
fun onRemeasured(size: IntSize)
```


Called after a layout's contents have been remeasured.



## Code Examples

### OnSizeChangedSample
```kotlin
@Composable
fun OnSizeChangedSample(name: String) {
    // Use onSizeChanged() for diagnostics. Use Layout or SubcomposeLayout if you want
    // to use the size of one component to affect the size of another component.
    Text(
        "Hello $name",
        Modifier.onSizeChanged { size -> println("The size of the Text in pixels is $size") },
    )
}
```

