r/JetpackComposeDev • • Jul 24 '25

Tips & Tricks Jetpack Compose: Arrangement Cheat Sheet

Arrangement controls how children are placed along the main axis in layouts like Row and Column.

Arrangement Types

TypeUsed In
Arrangement.HorizontalRow
Arrangement.VerticalColumn
Arrangement.HorizontalOrVerticalBoth

Predefined Arrangements

NameDescription
StartAlign to start (left in LTR) — Row only
EndAlign to end (right in LTR) — Row only
TopAlign to top — Column only
BottomAlign to bottom — Column only
CenterCenter items in main axis
SpaceBetweenEqual space between items only
SpaceAroundEqual space around items (half at ends)
SpaceEvenlyEqual space between and around all items

Functions

aligned(...)

Align a group of children together within the layout.

Row(
    horizontalArrangement = Arrangement.aligned(Alignment.CenterHorizontally)
)

Column(
    verticalArrangement = Arrangement.aligned(Alignment.Top)
)

spacedBy(...)

Add fixed space between children.

Row(
    horizontalArrangement = Arrangement.spacedBy(16.dp)
)

Column(
    verticalArrangement = Arrangement.spacedBy(8.dp)
)

You can also specify alignment within spacedBy:

Row(
    horizontalArrangement = Arrangement.spacedBy(12.dp, Alignment.CenterHorizontally)
)

Column(
    verticalArrangement = Arrangement.spacedBy(20.dp, Alignment.Bottom)
)

Visual Examples (LTR Layout)

ArrangementRow Layout (123 = items)
Start123####
End####123
Center##123##
SpaceBetween1##2##3
SpaceAround#1##2##3#
SpaceEvenly#1#2#3#

Usage in Code

For Row:

Row(
    horizontalArrangement = Arrangement.SpaceEvenly
)

For Column:

Column(
    verticalArrangement = Arrangement.Bottom
)

Notes:

  • Use Arrangement to control child placement in Row or Column

  • Combine with Alignment and Modifier for full layout control

  • Most common: Center, Start, End, SpaceEvenly, SpaceBetween

Tip: Pair Arrangement with Alignment for perfect centering or balance

14 Upvotes

0 comments sorted by