UI Foundations · Spacing
Spacing on a 4-point scale
Use a fixed set of gaps based on multiples of four, and let the size of the gap show how closely two things belong together.
Written by Inspireca Design (drafted with AI assistance)Updated Not yet reviewed by an editor
In short
- Limit yourself to a few gaps: 4, 8, 12, 16, 24, 32, 48.
- Things that belong together sit closer than things that do not.
- Space inside a component should be smaller than the space around it.
- Fix inconsistent spacing before you reach for lines and boxes.
Spacing does two jobs. It gives the eye room, and it tells people what belongs with what. A fixed scale of gaps makes both jobs easier, because every gap on the screen then means something.
The scale
A common choice is multiples of four: 4, 8, 12, 16, 24, 32, 48 pixels. Four is small enough for the gap between an icon and its label, and the larger steps grow fast enough that each one is visibly different. You can use multiples of eight instead; the point is to choose once and stop measuring by eye.
Closer means related
People read nearness as belonging. A label 4 px above its field and 24 px below the previous field is obviously the label of the field under it. Put the same label halfway between two fields and people have to work out which one it describes. When a form looks confusing, check the gaps before you change anything else.
Inside versus outside
A useful rule: the space inside a component is smaller than the space between components. A card with 16 px of padding should sit at least 16 px, and preferably 24 px, from the next card. If the inner gap is larger than the outer one, the contents of two cards look more related to each other than to their own card.
Screen edges
Pick one side margin for phone screens, commonly 16 px, and keep every screen on it. Content that starts at a different distance from the edge on each screen is one of the quickest ways to make an app feel unfinished.
Try it
Take one of your screens and replace every gap with the nearest value from the scale. Then look for places where you used a divider line or a box to separate two groups, and try a larger gap instead. Often the line was only there because the spacing was not doing its job.