Proximity
Things placed close together are read as belonging together, before anything is read.
Definition
A Gestalt grouping principle. Spatial nearness is one of the strongest and fastest cues the visual system uses to infer relationship, and it operates automatically before conscious reading.
Established research. Originates in published research and has been replicated. The effect is real. Its size in your product still needs measuring.
On this plate
Reach for this when
- Defining spacing tokens.
- Reviewing forms and long-form content.
- Diagnosing layouts that read as disorganised.
Common mistakes
- Uniform spacing everywhere, which removes all grouping information.
- Adding borders to fix a spacing problem.
- Grouping that contradicts the markup, which is confusing for sighted users and invisible in the accessibility tree.
- Adding a border to fix a grouping problem that was caused by the spacing being uniform.
Spacing is a statement about meaning
Whenever you set a margin you are declaring a relationship. Space inside a group must be smaller than space around it, or the grouping inverts and the reader binds the wrong elements.
This is the most common cause of forms that feel confusing despite correct markup. A label with equal space above and below floats between two fields and belongs to neither.
The spacing relationship, expressed in tokens
/* Inside a field group */
.field label { margin-block-end: var(--space-2); } /* 8px */
.field .hint { margin-block-start: var(--space-2); }
/* Between field groups */
.form .field + .field { margin-block-start: var(--space-6); } /* 24px */
/* Between sections */
.form section + section { margin-block-start: var(--space-10); } /* 40px */Space within a group is always a smaller step than space between groups. Keeping this ratio in tokens makes correct grouping the default.
Where proximity does the work
- Label to input: tight. Field to field: loose. The ratio should be at least two to one.
- Heading to its paragraph: tighter than paragraph to the next heading. Headings belong to what follows them.
- Caption to image: tight enough that no other element could claim it.
- Button groups: related actions close, destructive actions separated.
- Table cells: column padding wide enough that adjacent columns do not merge visually.
The spacing relationships that decide grouping
Every one of these is a ratio, not a value. What matters is that the inner space is clearly smaller than the outer.
| Relationship | Typical ratio | Failure when it is wrong |
|---|---|---|
| Label to its field | Tightest space in the form | The label attaches to the field above |
| Field to the next field | Two to three times the label gap | The form reads as one undifferentiated block |
| Field group to the next group | Twice the field gap, or a heading | Sections stop being sections |
| Heading to its content | Closer above than below | The heading reads as belonging to the previous block |
| Card padding to card gap | Padding smaller than the gap | Cards merge visually into a grid of noise |
In practice
- i.
The floating label
FormsEqual margins above and below a label make it ambiguous. Halving the space beneath it resolves the ambiguity instantly, with no new elements.
- ii.
Headings that belong upward
Long-form contentA heading with equal space above and below reads as separate from its section. Giving it roughly twice the space above binds it to the content it introduces.
- iii.
Equal spacing everywhere
Uniformity destroys groupingA form with one spacing value between every element says that nothing belongs to anything. Grouping is expressed by difference, so a single spacing token used uniformly removes the only signal available.
Local chart
FND·004 · Region II · Grid D2
This entry and the entries it is stated to connect with. Each line is labelled with what the connection means.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
- [1]
Untersuchungen zur Lehre von der Gestalt
M. Wertheimer, Psychologische Forschung, 1923
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Applies when you are designing
Principles behind this
The reasoning this solution is an application of.
- Law of PrägnanzLAW·017 · Law
- Miller's LawLAW·004 · Law
- Cognitive LoadPSY·001 · Psychology
Check your work
Review passes that test whether this was done properly.
- Form UX ChecklistCHK·001 · Checklist
Short definition
The one-paragraph version, for when that is all you need.
- ChunkingTERM·008 · Term
- Gestalt PrinciplesTERM·056 · Term
- WhitespaceTERM·055 · Term
Related concept
Connected closely enough to change how you apply this.
- AlignmentFND·003 · UI foundation
- Borders and DividersFND·047 · UI foundation
- Common RegionFND·006 · UI foundation
- SimilarityFND·005 · UI foundation
- Spacing SystemsFND·042 · UI foundation
- Visual HierarchyFND·001 · UI foundation
- WhitespaceFND·015 · UI foundation