Law of Proximity
Synonyms: proximity principle, Gestalt law of proximity, grouping by proximity, spatial grouping, whitespace grouping
Definition
Use cases
- 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.
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
- NN/g — 4 Principles to Reduce Cognitive Load in Forms — spacing related fields closer and sections further apart, with Slack and Stripe examples.
- IxDF — Laws of Proximity, Uniform Connectedness, and Continuation — a long read on proximity and the grouping laws that compete with it.
- Smashing Magazine — How To Use Spaces In Web Design With Gestalt Principles — real website examples of space doing the grouping work.
