Class

FlexDirection

Defines the direction of the main axis in a FlexBox container.

Source set: Common
@ExperimentalFlexBoxApi
value class FlexDirection @PublishedApi internal constructor(private val bits: Int)

Defines the direction of the main axis in a FlexBox 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.

Companion Object

Properties

Source set: Common
inline val Row

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).

Source set: Common
inline val Column

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).

Source set: Common
inline val RowReverse

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.

Source set: Common
inline val ColumnReverse

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.

Last updated: