Things placed close together look related. Spacing shows what belongs with what.
Objects near each other are perceived as a group. Spacing communicates relationship.
By Rohit Sonawane, product designer · Last reviewed 16 November 2026
The law of proximity is a Gestalt principle: things placed close together are seen as a group, and things far apart are seen as separate. Max Wertheimer described the Gestalt grouping principles in 1923. In UI design, spacing is the main way to show what belongs with what.
A sign-up form mixes account and delivery fields, all evenly spaced, with no boxes, lines or headings. Drag the fields into order and open the space between them until the eye sees two clear groups.
Keep the space inside a group clearly smaller than the space between groups, for example 8px inside and 24–32px between.
Put a price too far from its plan name and it drifts toward the neighbouring plan. Is that $29 for “Pro” or for “Team”? Tighten the spacing so each plan's name, price, feature list, and button hug each other, and the grouping is obvious without a single divider line. The whitespace does the work borders used to.
Proximity can fight other signals. A legal disclaimer tucked right under a “Buy” button gets read as part of the button, so sometimes you deliberately want separation. And in dense data tables, tight grouping can merge rows; alternating background bands often group better than spacing alone.
Someone seeing the screen for the first time can point out the groups without any lines or boxes to guide them.
A form where each label sits close to its own input and further from the next field, so it is obvious which label belongs to which box.
Often, yes. Spacing alone can group items cleanly, and extra borders add visual noise. Use boxes when spacing is not enough, for example in very dense layouts.
Proximity groups items by the space between them. Common region groups items by putting them inside the same container, such as a card or a shaded area.
A signup form lists 14 fields with equal spacing. Completion is 31%.