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
| Value | Description |
|---|---|
Row | Default. Items flow from left to right. |
Column | Items flow from top to bottom. |
RowReverse | Items flow from right to left. |
ColumnReverse | Items 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…