# FlexAlignContent

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/FlexBox.kt+class:androidx.compose.foundation.layout.FlexAlignContent) Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.11.0) Common/AllAndroid/JVM
- Cmn

  ```
  value class FlexAlignContent
  ```

*** ** * ** ***

Distributes flex lines along the cross axis.

Only applies when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexBoxConfigScope#wrap(androidx.compose.foundation.layout.FlexWrap)` is `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexWrap#Wrap()` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexWrap#WrapReverse()`, multiple lines exist, and the container has extra cross-axis space. Distributes and expands flex lines along the cross axis. Items within each line follow `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignItems` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignSelf` and do not stretch unless configured with `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignItems#Stretch()` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignSelf#Stretch()`.

```kotlin
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.FlexAlignContent
import androidx.compose.foundation.layout.FlexBox
import androidx.compose.foundation.layout.FlexBoxConfig
import androidx.compose.foundation.layout.FlexDirection
import androidx.compose.foundation.layout.FlexWrap
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp

// Can be extracted to a top-level FlexBoxConfig
val SpaceAroundWrap = FlexBoxConfig {
    direction(FlexDirection.Row)
    wrap(FlexWrap.Wrap)
    alignContent(FlexAlignContent.SpaceAround)
}

FlexBox(modifier = Modifier.fillMaxSize(), config = SpaceAroundWrap) {
    repeat(20) { Box(Modifier.size(80.dp).background(Color.Blue)) }
}
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexBoxConfigScope#alignContent(androidx.compose.foundation.layout.FlexAlignContent)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignItems` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignSelf` |   |

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent#Center()` Place lines such that they are as close as possible to the middle of the container's cross axis. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent#End()` Place lines such that they are as close as possible to the `cross-end` edge of the container. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent#SpaceAround()` Place lines such that they are spaced evenly across the cross axis, including free space before the first line and after the last line, but half the amount of space existing otherwise between two consecutive lines. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent#SpaceBetween()` Place lines such that they are spaced evenly across the cross axis, without free space before the first line or after the last line. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent#Start()` Place lines such that they are as close as possible to the `cross-start` edge of the container. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent#Stretch()` Stretches flex lines to fill available cross-axis space. | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignContent#toString()()` | Cmn |

## Public companion properties

### Center

Cmn

```
val Center: FlexAlignContent
```

Place lines such that they are as close as possible to the middle of the container's cross axis.

### End

Cmn

```
val End: FlexAlignContent
```

Place lines such that they are as close as possible to the `cross-end` edge of the container.

### SpaceAround

Cmn

```
val SpaceAround: FlexAlignContent
```

Place lines such that they are spaced evenly across the cross axis, including free space before the first line and after the last line, but half the amount of space existing otherwise between two consecutive lines.

### SpaceBetween

Cmn

```
val SpaceBetween: FlexAlignContent
```

Place lines such that they are spaced evenly across the cross axis, without free space before the first line or after the last line.

### Start

Cmn

```
val Start: FlexAlignContent
```

Place lines such that they are as close as possible to the `cross-start` edge of the container.

### Stretch

Cmn

```
val Stretch: FlexAlignContent
```

Stretches flex lines to fill available cross-axis space.

Distributes remaining cross-axis space evenly among all lines, expanding each line's cross-axis size. Positions items within each line according to `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignItems` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignSelf`. Items do not stretch unless configured with `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignItems#Stretch()` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignSelf#Stretch()`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignItems#Stretch()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexAlignSelf#Stretch()` |   |

## Public functions

### toString

Cmn

```
open fun toString(): String
```