Foundations

Spacing & Layout

A base-4 spacing scale with fine 2px steps, four semantic spacing roles, and a responsive grid that adapts from mobile to desktop XL — keeping visual rhythm predictable across every government service interface.

Base spacing scale

The primitive ramp every spacing token aliases. Built on a 4px rhythm with 2px fine steps for tight adjustments.

--ux4g-space-none
0px
0rem
--ux4g-space-1
2px
0.125rem
--ux4g-space-2
4px
0.25rem
--ux4g-space-3
6px
0.375rem
--ux4g-space-4
8px
0.5rem
--ux4g-space-5
12px
0.75rem
--ux4g-space-6
16px
1rem
--ux4g-space-7
20px
1.25rem
--ux4g-space-8
24px
1.5rem
--ux4g-space-9
32px
2rem
--ux4g-space-10
40px
2.5rem
--ux4g-space-11
48px
3rem
--ux4g-space-12
56px
3.5rem
--ux4g-space-13
64px
4rem
--ux4g-space-14
80px
5rem
--ux4g-space-15
120px
7.5rem

Semantic spacing

Role-based tokens that alias the base scale. Reach for these first — they describe intent (Inline, Stack, Padding, Section) rather than a raw number.

Inline

Horizontal gaps between elements on the same line.

XXS (--ux4g-inline-xxs)2px
XS (--ux4g-inline-xs)4px
S (--ux4g-inline-s)8px
M (--ux4g-inline-m)12px
L (--ux4g-inline-l)16px

Stack

Vertical gaps between stacked elements.

XXS (--ux4g-stack-xxs)4px
XS (--ux4g-stack-xs)8px
S (--ux4g-stack-s)12px
M (--ux4g-stack-m)16px
L (--ux4g-stack-l)24px

Padding

Inner padding for components and containers.

XXS (--ux4g-padding-xxs)4px
XS (--ux4g-padding-xs)8px
S (--ux4g-padding-s)12px
M (--ux4g-padding-m)16px
L (--ux4g-padding-l)20px
XL (--ux4g-padding-xl)24px
XXL (--ux4g-padding-xxl)32px

Section

Large gaps between page sections.

XS (--ux4g-section-xs)24px
S (--ux4g-section-s)32px
M (--ux4g-section-m)48px
XL (--ux4g-section-xl)64px
XXL (--ux4g-section-xxl)80px

Corner radius

Five radius tokens keep rounding consistent across components.

None

0px

Small

4px

Medium

8px

Large

12px

Full

Full

Pills & circular avatars

Grid visualization

The 12-column grid at desktop, and common column spans.

1
2
3
4
5
6
7
8
9
10
11
12
4 cols
8 cols
3
6 cols
3

Layout principles

Guidelines for consistent page structure across government services.

Content width

Max content width caps at 1200px on desktop and 1320px on desktop XL. Body text should not exceed ~720px (65–75 characters per line) for readability.

Vertical rhythm

Use Section spacing between major sections, Stack between related blocks, and Inline for on-line gaps — never raw pixel guesses.

Touch targets

Minimum 44×44px touch targets on mobile, with at least 8px (Inline S) spacing between interactive elements.

Density

Default density is optimized for citizen-facing services to ensure readability and accessibility.

UX4G Accessibility Tool
Dictionary
UX4G Accessibility Tool
Dictionary