Skip to main content
The Layout settings control how elements are arranged inside a container.
This is where you decide if items go side by side, stacked, centered, spaced, etc.
Layout

The 4 Key Settings

1. Direction (Most Important)

This controls how items are placed inside the container.

Horizontal (Row)

  • Elements go left β†’ right
  • Example: buttons next to each other
πŸ‘‰ Use this for:
  • Rows
  • Inline elements
  • Columns side by side

Vertical (Column)

  • Elements go top β†’ bottom
  • Example: title β†’ text β†’ button
πŸ‘‰ Use this for:
  • Forms
  • Stacked content
  • Most layouts (default)
If something is not aligning correctly, check Direction first β€” this is the #1 issue users face.

2. Distribution (Spacing Between Items)

This controls how items are spaced across the container. Common options:
  • Start β†’ items stick to the beginning
  • Center β†’ items stay in the middle
  • End β†’ items go to the end
  • Space Between β†’ first left, last right, space in between
  • Space Around β†’ equal space around items

πŸ‘‰ Example: If you have 3 buttons:
  • Space Between β†’ spread across full width
  • Center β†’ grouped in the middle

3. Align Items (Alignment)

This controls alignment on the opposite axis of Direction.

If Direction = Row (horizontal):

  • Align Items = vertical alignment
    • Top
    • Center
    • Bottom

If Direction = Column (vertical):

  • Align Items = horizontal alignment
    • Left
    • Center
    • Right
Important:
  • Direction = main axis
  • Align Items = cross axis
(This is where most confusion happens)

4. Gap

  • Controls space between elements
  • Works like automatic spacing
πŸ‘‰ Example:
  • Gap = 20 β†’ adds equal spacing between all items

Simple Examples

Example 1: Center everything

  • Direction: Vertical
  • Align Items: Center
  • Distribution: Center
πŸ‘‰ Result: everything perfectly centered

Example 2: Buttons in a row

  • Direction: Horizontal
  • Distribution: Space Between
  • Align Items: Center
πŸ‘‰ Result: buttons spread across horizontally

Example 3: Simple form layout

  • Direction: Vertical
  • Align Items: Left
  • Gap: 10–20
πŸ‘‰ Result: clean vertical form

Common Mistakes

❌ Trying to center elements without changing Direction
❌ Confusing Align Items with Distribution
❌ Adding margin instead of using Gap
❌ Forgetting container controls child elements

Best Practices

  • Start with Column for most layouts
  • Use Row only when needed
  • Use Gap instead of manual spacing
  • Keep layouts simple and consistent
Golden Rule:
If something looks β€œwrong”, it’s almost always:
  • Wrong Direction
  • Wrong Alignment