Free guideThe newsletter. Real UI fixes by email, and a free 35-page guide to AI design skills.
Ship Better UI

, 1 minute 23 seconds

How do you group things in a UI without divider lines?

The rule

Keep every gap inside a group smaller than the gap between groups: labels 8 px from their own box and 20 px from the one above, 8 to 20 px inside a group, 32 px between groups, and no divider lines.

Try it

Apply the fix

Prompt for your AI coding tool

Paste it into Claude Code, Cursor or any AI coding tool, then share the page you want fixed.

Review the interface I share for groups that lean on divider lines or on gaps that are all the same. Group it with space instead, and change nothing else.

1. Labels: put each label 8 px from its own box and 20 px from the box above, so it clearly belongs to its own field.
2. Groups: inside a group, keep the gaps between 8 and 20 px. Between groups, use 32 px. Every gap inside a group stays smaller than the gap between groups.
3. Dividers: delete the divider lines that only repeat what the space now says. Move the space rather than add more, so the card or screen keeps its height.

Keep the content, the features and the colours. When you are done, list each gap you changed (what it was, what it is now) and each line you removed.

More prompts like this in the free guide 

The problem

The settings card in the video holds a Profile group, with Full name and Email, and a Notifications group, with two switches, above a Save changes button. Every gap in it is the same, 16 px. So nothing looks grouped, and four divider lines try to do the job instead. The Email label shows it best: it sits 16 px from the box above and 16 px from its own box, so it could belong to either.

The fix

  1. Labels. Put each label 8 px from its own box and 20 px from the one above. Now it clearly belongs.
  2. Groups. Inside a group, keep the gaps between 8 and 20 px. Between groups, use 32 px.
  3. Dividers. The lines have nothing left to do, so delete all four.

Why it works

Things that sit close together read as one group. Designers call this the law of proximity. When every gap is equal, the space says nothing, so lines have to say it for you. Once the gaps inside a group are smaller than the gap between groups, the space draws the line and the dividers only repeat it. Nothing was added to make this work. The card is the same height, with the same 128 px of space. The space moved.

How to apply it

Look at the gaps in your next form or settings screen before you reach for a border. Pick small gaps for things that belong together and a larger one between groups, and keep every gap inside a group smaller than the gap between groups. Then take the lines out and check that the groups still read.

Free guide · 35 pages

Get fixes like this by email

Join the newsletter and get the 35-page guide to AI design skills: the skills, the order to use them in, and prompts to copy.

Watch it on

More on space