<div class='type'>Compose Modifier</div>

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


<h2 id="fitinside-rulers">fitInside</h2>

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


```kotlin
fun Modifier.fitInside(rulers: RectRulers): Modifier
```


Fits the contents within `rulers`. This only works when `Constraints` have
`fixed width` and `fixed height`. This can
be accomplished, for example, by having `Modifier.size`, or `Modifier.fillMaxSize`, or other size
modifier before `fitInside`. If the `Constraints` sizes aren't fixed, `fitInside` will size the
child to the `Constraints` and try to center the content within `rulers`.