# FlexDirection

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

  ```
  value class FlexDirection
  ```

*** ** * ** ***

Defines the direction of the main axis in a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexBox.composable#FlexBox(androidx.compose.ui.Modifier,androidx.compose.foundation.layout.FlexBoxConfig,kotlin.Function1)` container.

The main axis determines the primary direction in which children are laid out. It establishes the `main-start` and `main-end` edges of the container. The cross axis is always perpendicular to the main axis.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexBoxConfigScope#direction(androidx.compose.foundation.layout.FlexDirection)` |   |

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection#Column()` The main axis is vertical. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection#ColumnReverse()` The main axis is vertical, but the placement direction is reversed. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection#Row()` The main axis is horizontal. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/FlexDirection#RowReverse()` The main axis is horizontal, but the placement direction is reversed. | 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/FlexDirection#toString()()` | Cmn |

## Public companion properties

### Column

Cmn

```
val Column: FlexDirection
```

The main axis is vertical. Items are placed starting from the `main-start` edge (the top of the container) and flowing toward the `main-end` edge (the bottom).

### ColumnReverse

Cmn

```
val ColumnReverse: FlexDirection
```

The main axis is vertical, but the placement direction is reversed. The `main-start` edge becomes the bottom of the container, and items flow toward the `main-end` edge at the top.

### Row

Cmn

```
val Row: FlexDirection
```

The main axis is horizontal. Items are placed starting from the `main-start` edge and flowing toward the `main-end` edge.

In a Left-To-Right (LTR) layout direction, `main-start` corresponds to the start (left) edge of the container. In a Right-To-Left (RTL) layout direction, `main-start` corresponds to the end (right).

### RowReverse

Cmn

```
val RowReverse: FlexDirection
```

The main axis is horizontal, but the placement direction is reversed. The `main-start` and `main-end` edges are swapped.

In a Left-To-Right (LTR) layout direction, `main-start` becomes the right edge of the container, and items flow leftward. In a Right-To-Left (RTL) layout direction, `main-start` becomes the left edge.

## Public functions

### toString

Cmn

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