Skip to main content

Spacing

To ensure that layouts are visually balanced, most measurements align to 8px, which corresponds to both spacing and the overall layout. Consistent spacing creates visual balance that makes the user interface (UI) easier for merchants to scan. Apply consistent spacing to improve the quality of the UI. Components are sized in 8px increments, ensuring a consistent visual rhythm across each screen. Smaller elements, such as icons, can align to a 4px grid, while typography can fall on a 4px baseline grid, meaning that each line’s typographic baseline is spaced in increments of 4px from its neighbor.

Principles

Create visual rhythm
We use incrementally measured spacing to create harmonious arrangements of components and text. This gives the elements a predictable rhythm, which makes the experience as a whole feel intentional and well designed.

Precise but flexible
Beyond mathematical precision, spacing also reacts to the objects it surrounds, giving more space to larger objects, less to small. Optical adjustments can also be made if an element looks off and the spacing needs a nudge to make things feel right.

Two types of spacing scale

Component Spacing
Controls the spacing inside the components.
For components use smaller increments. ( 4px, 8px, 12px, 16px, 20px, 24px, 32px, 36px, 40px, 48px)

Layout Spacing
Controls space between the components.
For layout scale use larger increments (16px, 24px, 32px, 48px, 64px, 96px )

Spacing Gaps in pixels

Token namePixelsTypically used
space-0251pxnot typically used
space-052pxnot typically used
space-14pxseparate related elements and for small padding
space-28pxonly for right and left padding of buttons, form elements and horizontal tabs
space-312pxto separate unrelated elements or groups and for normal padding
space-416pxto separate sub-sections of content
space-520pxto separate sub-sections of content
space-624pxto separate sub-sections of content
space-728pxto separate sections of content
space-832pxto separate sections of content
space-936pxto separate sections of content
space-1040px
space-1144px
space-1248px
space-1352px
space-1456px
space-1560px
space-1664px
space-1768px
space-1872px
space-1976px
space-2080px
space-2496px

Spacing Gaps in rem

Token nameRem
rem-space-0250.063rem
rem-space-050.125rem
rem-space-10.25rem
rem-space-20.5rem
rem-space-30.75rem
rem-space-41rem
rem-space-51.25rem
rem-space-61.5rem
rem-space-71.75rem
rem-space-82rem
rem-space-92.25rem
rem-space-102.5rem
rem-space-112.75rem
rem-space-123rem
rem-space-133.25rem
rem-space-143.5rem
rem-space-153.75rem
rem-space-164rem
rem-space-174.25rem
rem-space-184.5rem
rem-space-194.75rem
rem-space-205rem
rem-space-246rem

Spacing Gaps in em

Token nameRem
em-space-0250.063em
em-space-050.125em
em-space-10.25em
em-space-20.5em
em-space-30.75em
em-space-41em
em-space-51.25em
em-space-61.5em
em-space-71.75em
em-space-82em
em-space-92.25em
em-space-102.5em
em-space-112.75em
em-space-123em
em-space-133.25em
em-space-143.5em
em-space-153.75em
em-space-164em
em-space-174.25em
em-space-184.5em
em-space-194.75em
em-space-205em
em-space-246em