Flex Direction

Define the main axis direction.

The flexDirection property establishes the main-axis, causing items to layout either horizontally (rows) or vertically (columns).

Values

ValueDescription
RowDefault. Items flow from left to right.
ColumnItems flow from top to bottom.
RowReverseItems flow from right to left.
ColumnReverseItems flow from bottom to top.

Visual Guide

Row: [Item 1] -> [Item 2] -> [Item 3] Column: [Item 1] | v [Item 2] | v [Item 3]

Row

Default behavior. Items are placed from left to right.

Loading Preview…

RowReverse

Items are placed from right to left.

Loading Preview…

Column

Items are placed from top to bottom.

Loading Preview…

ColumnReverse

Items are placed from bottom to top.

Loading Preview…

Next Steps

© 2026 ByteLand Technology Limited