Layout and Spacing
Layout determines whether the interface feels calm or chaotic before the user reads a single word.
Page Anatomy
A reliable web UI usually has these layers:
| Layer | Purpose |
|---|---|
| Global navigation | Orientation, movement between major areas |
| Page header | Context: title, status, primary action |
| Primary content | The main task or information |
| Secondary content | Supporting filters, metadata, help, or related items |
| Utility layer | Toasts, banners, modals, drawers |
Users should be able to distinguish these layers at a glance.
Use a Layout System, Not Improvised Pixels
Recommended spacing scale
| Token | Size | Typical Use |
|---|---|---|
space-1 | 4px | Tight icon padding, tiny gaps |
space-2 | 8px | Related inline items |
space-3 | 12px | Input internal padding |
space-4 | 16px | Default gaps between related controls |
space-6 | 24px | Space between sections inside a card |
space-8 | 32px | Separation between major page sections |
space-12 | 48px | Hero spacing or large section breaks |
Do not choose spacing ad hoc. Reuse a defined scale.
Build on Grid Logic
| Context | Strong Default |
|---|---|
| Marketing pages | 12-column grid with generous whitespace |
| SaaS app shell | Fixed sidebar + fluid content area |
| Forms | Single column unless paired fields improve speed |
| Data views | Sticky toolbar + table or cards below |
| Dashboards | Card grid with consistent row rhythm |
Relationship Rules
Spacing should communicate relationship.
- items inside the same group should sit closer together
- distance between groups should be visibly larger than distance within groups
- labels belong visually to their inputs
- headings belong visually to the content they introduce
If everything has the same spacing, nothing feels organized.
Reading Patterns
| Pattern | Best For | Design Implication |
|---|---|---|
| F-pattern | Text-heavy pages | Strong left edge, clear headings, bullets |
| Z-pattern | Landing pages | Headline, supporting proof, CTA, closing anchor |
| Layered scan | Apps and dashboards | Strong header, left navigation, card groupings |
Content Width Rules
| Element | Guideline |
|---|---|
| Body text | 45-75 characters per line |
| Forms | Narrow enough to feel easy, usually 480-720px max |
| Dense tables | Allow width, but keep key actions and headers visible |
| Hero copy | Keep compact so the CTA remains above the fold when possible |
Use White Space as a Feature
White space is not empty. It creates focus.
Good uses of white space:
- isolating the primary CTA
- separating product tiers on pricing pages
- giving forms room to breathe
- making dashboards readable without borders everywhere
Bad uses of white space:
- wasting vertical space so important actions fall below the fold
- making related information feel disconnected
- hiding product value behind oversized decorative sections
Practical Layout Example
Use a stable shell before decorating details.
<main class="page">
<header class="page-header">
<div>
<h1>Invoices</h1>
<p>Track unpaid invoices and follow up quickly.</p>
</div>
<button>Create invoice</button>
</header>
<section class="summary-grid">
<article>Overdue: 12</article>
<article>Due this week: 31</article>
<article>Collected this month: $84,200</article>
</section>
<section class="data-region">
<aside class="filters">…filters…</aside>
<div class="table-wrap">…table…</div>
</section>
</main>
.page {
max-width: 1200px;
margin: 0 auto;
padding: 32px 24px 64px;
}
.page-header,
.data-region {
display: grid;
gap: 24px;
}
.summary-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 16px;
margin-block: 32px;
}
Layout Patterns That Convert Well
Pricing page
- Clear headline and target user framing
- Simple plan comparison with one recommended option
- FAQ and objection handling below
- Final CTA after social proof or reassurance
Checkout
- Progress indicator
- Main form on the left, order summary on the right on desktop
- Trust, refund, and security cues near the purchase action
- No unnecessary exits or promotional clutter
App dashboard
- Title and key status at top
- Filters close to the data they change
- Summary metrics first, detail beneath
- Empty state with next best action
Common Mistakes
| Mistake | Better Move |
|---|---|
| Putting actions far from the content they affect | Keep controls adjacent to the object they change |
| Using centered body copy in complex flows | Left-align for faster scanning |
| Adding borders to compensate for weak spacing | Fix spacing and grouping first |
| Overusing multi-column forms | Use one column unless pairing is clearly faster |
Review Checklist
- Is the primary action visible without hunting?
- Does spacing reveal hierarchy?
- Do headers, content, and actions feel like coherent groups?
- Is the layout calm on both large and small screens?
- Can a new user scan the screen in five seconds and describe its purpose?