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

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


<h2 id="height-intrinsicsize">height</h2>

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


```kotlin
fun Modifier.height(intrinsicSize: IntrinsicSize) =
    this then
        IntrinsicHeightElement(
            height = intrinsicSize,
            enforceIncoming = true,
            inspectorInfo =
                debugInspectorInfo {
                    name = "height"
                    properties["intrinsicSize"] = intrinsicSize
                },
        )
```


Declare the preferred height of the content to be the same as the min or max intrinsic height of
the content. The incoming measurement `Constraints` may override this value, forcing the content
to be either smaller or larger.

See `width` for other options of sizing to intrinsic width. Also see `height` and `heightIn` for
other options to set the preferred height.

Example usage for min intrinsic:


Example usage for max intrinsic:





<hr class="docs-overload-divider">


<h2 id="height-height">height</h2>

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


```kotlin
fun Modifier.height(height: Dp) =
    this.then(
        SizeElement(
            minHeight = height,
            maxHeight = height,
            enforceIncoming = true,
            inspectorInfo =
                debugInspectorInfo {
                    name = "height"
                    value = height
                },
        )
    )
```


Declare the preferred height of the content to be exactly `height`dp. The incoming measurement
`Constraints` may override this value, forcing the content to be either smaller or larger.

For a modifier that sets the height of the content regardless of the incoming constraints see
`Modifier.requiredHeight`. See `width` or `size` to set other preferred dimensions. See
`widthIn`, `heightIn` or `sizeIn` to set a preferred size range.