Skip to content
Inspireca Design

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.

  • UI Foundations

    Layout grids for phone screens

    On a phone, a grid is mostly two decisions: the side margin and how items share the width. Make them once and every screen lines up.

  • AI UI Prompts

    Structure a settings screen

    Groups a raw list of settings into sections with clear labels, chooses the right control for each, and puts risky actions last.

  • Interactive Examples

    Skeleton loading placeholder

    Grey shapes hold the place of content while it loads, in the same layout, so nothing jumps when the real content arrives.

  • Interactive Examples

    Tabs with a sliding indicator

    A marker that slides to the selected tab shows where you came from and where you are, with full arrow-key support.