# MaxSizeScope

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleScope.kt+class:androidx.compose.foundation.style.MaxSizeScope) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.12.0) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  interface MaxSizeScope
  ```
Known direct subclasses [LayoutStyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/LayoutStyleScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/LayoutStyleScope` | An interface that introduces the layout properties to a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` receiver scope. |

Known indirect subclasses [StyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` | A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` is the receiver scope of a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` lambda. |

*** ** * ** ***

An interface that introduces `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxWidth(androidx.compose.ui.unit.Dp)` and `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxHeight(androidx.compose.ui.unit.Dp)` properties to a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` receiver scope.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` |   |

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxHeight(androidx.compose.ui.unit.Dp)(value: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)` Constrains the maximum height of the component. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxWidth(androidx.compose.ui.unit.Dp)(value: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)` Constrains the maximum width of the component. | Cmn |

| ### Extension functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#(androidx.compose.foundation.style.MaxSizeScope).maxSize(androidx.compose.ui.unit.DpSize)(size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize)` Constrains the maximum size (width and height) of the component. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#(androidx.compose.foundation.style.MaxSizeScope).maxSize(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)(width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)` Constrains the maximum width and height of the component. | Cmn |

## Public functions

### maxHeight

Cmn Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.12.0)

```
fun maxHeight(value: Dp): Unit
```

Constrains the maximum height of the component. The component's height, including padding, will be at most this value.

This property is *not* inherited

| Parameters |
|---|---|
| `value: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The maximum height. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.MaxSizeScope).maxSize(androidx.compose.ui.unit.DpSize)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MinSizeScope#minHeight(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/heightIn.modifier#(androidx.compose.ui.Modifier).heightIn(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)` |   |

### maxWidth

Cmn Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.12.0)

```
fun maxWidth(value: Dp): Unit
```

Constrains the maximum width of the component. The component's width, including padding, will be at most this value.

This property is *not* inherited

| Parameters |
|---|---|
| `value: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The maximum width. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxHeight(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.MaxSizeScope).maxSize(androidx.compose.ui.unit.DpSize)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MinSizeScope#minWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/widthIn.modifier#(androidx.compose.ui.Modifier).widthIn(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)` |   |

## Extension functions

### MaxSizeScope.maxSize

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleScope.kt+function:maxSize)

```
@ExperimentalFoundationStyleApi
fun MaxSizeScope.maxSize(size: DpSize): Unit
```

Constrains the maximum size (width and height) of the component. The component's dimensions, including padding, will be at most these values.

This property is *not* inherited

| Parameters |
|---|---|
| `size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` | The maximum size (`https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize`). |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxHeight(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/sizeIn.modifier#(androidx.compose.ui.Modifier).sizeIn(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)` |   |

### MaxSizeScope.maxSize

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleScope.kt+function:maxSize)

```
@ExperimentalFoundationStyleApi
fun MaxSizeScope.maxSize(width: Dp, height: Dp): Unit
```

Constrains the maximum width and height of the component. The component's dimensions, including padding, will be at most these values.

This property is *not* inherited

| Parameters |
|---|---|
| `width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The maximum width. |
| `height: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | The maximum height. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxWidth(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/MaxSizeScope#maxHeight(androidx.compose.ui.unit.Dp)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/sizeIn.modifier#(androidx.compose.ui.Modifier).sizeIn(androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp)` |   |