Back to Glossary

Law of Proximity

Synonyms: proximity principle, Gestalt law of proximity, grouping by proximity, spatial grouping, whitespace grouping

Do not index

Definition

The Law of Proximity states that people naturally perceive objects placed close together as belonging to the same group. It comes from Gestalt psychology, developed in the 1920s.
In UI design, spacing helps users understand relationships between elements. For example, placing a label close to its input field shows they belong together, while larger gaps separate different sections.
 

Use cases

Bad spacing makes users guess. Guesses become wrong inputs and wrong clicks.
  • Forms: A label sits the same distance from the field above and below it. Users type their phone number into the email field.
  • Product cards: A price sits closer to the next card’s image than its own. Shoppers compare the wrong item.
  • Destructive actions: “Delete” sits 8px from “Save” in the same button row. Users read them as equal actions and lose their work.
 

How it's used in practice

  • Pick a spacing scale first: Use 4px or 8px steps.
  • Tight inside, loose between: Keep label-to-field at 4–8px and field-to-next-label at 16–24px.
  • Try space before borders: Remove a card’s border. If the groups still read clearly, leave it off.
  • Run a blur test: Blur the screen in review. The shapes you see are the groups users see.
  • Hand off spacing as tokens: Name gaps (space-sm, space-lg) so developers stop eyeballing margins.
🪄
Make the gap between groups at least 2x the gap inside them. At 1.5x or less, the difference vanishes on a busy screen and everything reads as one block.
 

Challenges & limitations

  • Small screens squeeze gaps: Responsive layouts shrink margins first, so groups that worked on desktop merge on mobile.
  • Stronger cues win: A border or shared background groups items no matter how they’re spaced.
  • Dense UIs run out of room: Dashboards and data tables can’t separate every group with space. You’ll need dividers or shading too.
 

Free resources

Share this post

Get free UX resources

Get portfolio templates, list of job boards, UX step-by-step guides, and more.

Download for FREE
 
 

The best email 📮 for growing 🌱 designers

Honest notes about the work behind the work. Read in 2 minutes, weekly. Free forever.
 
 
     
    notion image
    Join 13,045 designers and get tactics, hacks, and tips.