# BoxWithConstraintsScope

# BoxWithConstraintsScope

Artifact:[androidx.compose.foundation:foundation-layout](https://developer.android.com/jetpack/androidx/releases/compose-foundation)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/layout/BoxWithConstraints.kt+class:androidx.compose.foundation.layout.BoxWithConstraintsScope)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  interface BoxWithConstraintsScope : BoxScope
  ```

*** ** * ** ***

Receiver scope being used by the children parameter of[BoxWithConstraints](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#BoxWithConstraints(androidx.compose.ui.Modifier,androidx.compose.ui.Alignment,kotlin.Boolean,kotlin.Function1))

## Summary

|                                       ### Public properties                                        |
|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Constraints](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints) | [constraints](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#constraints()) The constraints given by the parent layout in pixels.                                              | Cmn |
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)                   | [maxHeight](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#maxHeight()) The maximum height in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp). | Cmn |
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)                   | [maxWidth](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#maxWidth()) The maximum width in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp).    | Cmn |
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)                   | [minHeight](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#minHeight()) The minimum height in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp). | Cmn |
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)                   | [minWidth](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#minWidth()) The minimum width in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp).    | Cmn |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.compose.foundation.layout.BoxScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxScope) |-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----| | [Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier) | [Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)`.`[align](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxScope#(androidx.compose.ui.Modifier).align(androidx.compose.ui.Alignment))`(alignment: `[Alignment](https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment)`)` Pull the content element to a specific[Alignment](https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment)within the[Box](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#Box(androidx.compose.ui.Modifier,androidx.compose.ui.Alignment,kotlin.Boolean,kotlin.Function1)). | Cmn | | [Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier) | [Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)`.`[matchParentSize](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxScope#(androidx.compose.ui.Modifier).matchParentSize())`()` Size the element to match the size of the[Box](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#Box(androidx.compose.ui.Modifier,androidx.compose.ui.Alignment,kotlin.Boolean,kotlin.Function1))after all other content elements have been measured.                                                                                                                                                             | Cmn | |

## Public properties

### constraints

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

```
val constraints: Constraints
```

The constraints given by the parent layout in pixels.

Use[minWidth](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#minWidth()),[maxWidth](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#maxWidth()),[minHeight](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#minHeight())or[maxHeight](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#maxHeight())if you need value in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp).  

### maxHeight

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

```
val maxHeight: Dp
```

The maximum height in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp).  

|                                                                See also                                                                |
|----------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| [constraints](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#constraints()) | for the values in pixels. |

### maxWidth

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

```
val maxWidth: Dp
```

The maximum width in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp).  

|                                                                See also                                                                |
|----------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| [constraints](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#constraints()) | for the values in pixels. |

### minHeight

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

```
val minHeight: Dp
```

The minimum height in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp).  

|                                                                See also                                                                |
|----------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| [constraints](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#constraints()) | for the values in pixels. |

### minWidth

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

```
val minWidth: Dp
```

The minimum width in[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp).  

|                                                                See also                                                                |
|----------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| [constraints](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsScope#constraints()) | for the values in pixels. |