UI Design Guidelines — Numbers, Tokens, and Rules You Can Copy (2025)

This page is a practical UI rulebook. It prioritizes speed, clarity, accessibility, and measurable performance. Use these as defaults, then test with real traffic.

How to use: Apply the “Sweetspot Defaults” first. Then adopt tokens. Avoid one-off styling. Consistency improves comprehension. Comprehension improves clicks.

Last updated: 31 Dec 2025. Includes updated guidance for WCAG 2.2 target sizing and INP responsiveness.

Quick start (3 steps)

  • Apply Sweetspot Defaults (colors, measure, targets, spacing rhythm).
  • Copy tokens (spacing, radii, states) and use them everywhere.
  • Ship + measure (CTR, scroll depth, form completion, Core Web Vitals).

Mini UI specimen

This is what “default good UI” should feel like.

Jump to

Use this page like a checklist. If a screen violates these rules, it usually loses clicks.


Sweetspot Defaults

These defaults produce consistently readable, tappable, fast UI. Use them everywhere unless you have evidence to change them.

  • Page background: #F6F7F9
  • Content surface (cards / article area): #FFFFFF
  • Primary text: #111111
  • Secondary text: #4B5563
  • Border: #E5E7EB
  • Link color: #0047FF (always underlined)
  • Primary CTA background: #0047FF
  • Primary CTA text: #FFFFFF
  • Container width (site): 1120px
  • Reading measure (text column): 68ch
  • Desktop page padding: 32px
  • Mobile page padding: 16px
  • Grid: 12 columns desktop, 4 columns mobile
  • Gutter: 24px desktop, 16px mobile
  • Base spacing unit: 8px (use 4px only for micro spacing)
  • Body font size: 16px
  • Body line-height: 1.55
  • Primary button height (mobile): 52px
  • Primary button height (desktop): 44px
  • Minimum touch target: 48px × 48px
  • Default corner radius: 12px
  • One primary action per screen: exactly one dominant CTA

“Looks good” check (10 seconds)

  • Text is easy at first glance (no cramped measure).
  • Links look like links (underlined).
  • One action visually wins (CTA isolation).
  • Tap targets feel generous (48×48).
  • No layout shift when fonts/images load.
Bad vs good (spacing)
Bad
Tight line-height and cramped padding slow scanning. Users hesitate.
CTA
Good
Comfortable rhythm. Users decide faster and click sooner.
Primary action

Design Tokens

Tokens are a performance tool. They prevent random UI. Random UI increases hesitation. Hesitation reduces CTR.

Copy-paste CSS variables (2025 baseline)

:root{
  /* Fonts (best-practice stacks) */
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
  --font-serif: "Source Serif 4", Literata, ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;

  /* Layout */
  --container: 1120px;
  --measure: 68ch;

  /* Page padding */
  --pad-mobile: 16px;
  --pad-desktop: 32px;

  /* Grid gutters */
  --gutter-mobile: 16px;
  --gutter-desktop: 24px;

  /* Spacing (8px rhythm) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radii */
  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 16px;

  /* Controls */
  --control-h-mobile: 52px;
  --control-h-desktop: 44px;
  --input-h: 48px;
  --target: 48px;

  /* Type */
  --text-base: 16px;
  --lh-body: 1.55;
  --text-sm: 13px;
  --lh-sm: 1.45;

  /* Surfaces */
  --bg: #F6F7F9;
  --surface: #FFFFFF;

  /* Text */
  --text: #111111;
  --text-2: #4B5563;

  /* Borders */
  --border: #E5E7EB;

  /* Brand / actions */
  --cta: #0047FF;
  --cta-text: #FFFFFF;

  /* Semantics */
  --success: #16A34A;
  --warning: #F59E0B;
  --error: #D72638;
  --info: #2563EB;

  /* Focus ring */
  --focus: #0B5FFF;

  /* Motion */
  --t-fast: 120ms;
  --t: 200ms;
  --t-slow: 300ms;
}

Button baseline CSS (safe default)

.btn-primary{
  min-height: var(--control-h-mobile);
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--cta);
  color: var(--cta-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 700 var(--text-base)/1 var(--font-sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  user-select: none;
  transition: transform var(--t-fast) ease, filter var(--t-fast) ease;
}

.btn-primary:hover{ filter: brightness(0.96); }
.btn-primary:active{ transform: scale(0.99); }

.btn-primary:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn-secondary{
  min-height: var(--control-h-mobile);
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 var(--text-base)/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover{ background: rgba(0,0,0,0.03); }

.btn-secondary:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (min-width: 1024px){
  .btn-primary, .btn-secondary{ min-height: var(--control-h-desktop); }
}

Layout, Widths, Grid, Margins

This completes the width system. It prevents two CTR killers: cramped UI and wandering alignment.

  • Site container: 1120px (centered)
  • Reading column: 68ch (apply to paragraphs and long-form blocks)
  • Full-bleed sections: allowed, but keep text inside a container
  • Desktop page padding: 32px
  • Mobile page padding: 16px
  • Grid: 12 columns desktop, 4 columns mobile
  • Gutter: 24px desktop, 16px mobile
  • Alignment: everything aligns to the same left edge

Grid visual (12 columns)

Use 12 columns on desktop and collapse to 4 columns on mobile.

In-page Section Menu (Sticky) — recommended geometry

  • Sticky menu width: 280px
  • Menu-to-content gap: 32px
  • Content column max: 760px
  • Total inside container: 280 + 32 + 760 = 1072px
  • Sticky offset from top: 16px (below header)

Breakpoints (only when layout breaks)

BreakpointLabelUse it for
≤ 480pxMobileSingle-column, big tap targets, simplified nav
481–768pxLarge mobile / small tabletTwo-up cards only if it stays readable
769–1024pxTabletGrid begins, but keep measure controlled
≥ 1024pxDesktopFull grid, denser information, 44px controls
≥ 1280pxWideOnly if you have a real need (don’t stretch text)

Spacing, Padding, Rhythm

Spacing is a conversion lever because it controls scan speed. Use a strict rhythm.

  • Base unit: 8px
  • Micro spacing: 4px (icons, tight labels)
  • Card padding: 24px
  • Card-to-card gap: 24px
  • Section spacing: 48px
  • Heading-to-content spacing: 16px
  • Paragraph spacing: 12px
  • Form field spacing: 16px

Rule: if you can’t name the spacing token, you’re creating inconsistency.

Spacing scale (visual)
4px
micro
8px
base
16px
block gap
24px
card padding
48px
section spacing

Typography (and Font Recommendations)

Typography is the highest ROI UI layer. If reading is effortless, people move and click.

StyleSizeLine-heightWeightUse
H1clamp(30px, 3.2vw, 44px)1.12750One per page
H2clamp(24px, 2.2vw, 32px)1.18750Primary sections
H3clamp(20px, 1.6vw, 24px)1.25750Sub-sections
Body16px1.55400–500Main reading
Small13px1.45400–500Meta, captions
  • Reading measure: 68ch for paragraphs
  • Sentence case: for labels and buttons
  • Never center long text: scan speed drops
  • Headings must be literal: “Buttons” beats “Make it pop”

Best-of-best font recommendations (practical)

  • Best default (UI + performance): Inter variable (UI) + optional Source Serif 4 for long reading.
  • System-first (fastest): system-ui stack only (no web font), limit weights (400/600/750).
  • Accessibility-forward option: Atkinson Hyperlegible for dense UI (test; it’s opinionated).
  • Rule: 1 UI font + optional 1 reading font. More fonts increase load + inconsistency.

Font performance rules (non-negotiable)

  • Prefer variable fonts (fewer files).
  • Self-host WOFF2, subset languages, use font-display: swap.
  • Don’t ship 9 weights. Ship 2–3 (e.g., 400 / 600 / 750).
  • Avoid layout shift: stable fallbacks + similar metrics.

Color, Contrast, Backgrounds, States

There is no universal “best CTA color”. The consistent winner is contrast and distinctiveness. Your CTA must be the most visually dominant element, while staying accessible.

Best-performing text background (sweetspot)

  • Page background: #F6F7F9 (reduces visual noise)
  • Text surface: #FFFFFF (highest clarity)
  • Primary text: #111111
  • Secondary text: #4B5563
  • Border/divider: #E5E7EB

CTA color (sweetspot)

  • CTA background: #0047FF
  • CTA text: #FFFFFF
  • Focus ring: #0B5FFF
  • Rule: do not use the CTA color for non-CTA decoration
  • Rule: links are always underlined

Neutral scale (use for 90% of UI)

Neutral 0
#FFFFFF
Neutral 50
#F6F7F9
Neutral 100
#EEF0F3
Neutral 200
#E5E7EB
Neutral 300
#D1D5DB
Neutral 400
#9CA3AF
Neutral 500
#6B7280
Neutral 600
#4B5563
Neutral 700
#374151
Neutral 800
#1F2937
Neutral 900
#111111

Primary scale (use sparingly)

Blue 50
#E8F0FF
Blue 100
#D6E4FF
Blue 200
#ADC8FF
Blue 300
#84A9FF
Blue 400
#5B8CFF
Blue 500
#2E6BFF
Blue 600 (CTA)
#0047FF
Blue 700
#0038CC

Semantic colors (use only for meaning)

Success
#16A34A
Warning
#F59E0B
Error
#D72638
Info
#2563EB

State rules (non-negotiable)

  • Every interactive element has default, hover, focus, pressed, disabled.
  • Disabled must look disabled. Grey often implies disabled. Use it intentionally.
  • Focus must be obvious. Use a 3px ring with offset.
  • Never encode state in color only. Add text and/or icon for errors.

Buttons state preview (visual)

Default
Primary action
Hover
Primary action
Focus
Primary action
Disabled
Primary action

Buttons, Tap Targets, Links

Buttons are conversion levers. Your default should be “easy to hit, easy to understand, impossible to miss”.

  • Primary button height (mobile): 52px
  • Primary button height (desktop): 44px
  • Minimum touch target: 48px × 48px
  • Button padding: 18px left/right
  • Button radius: 12px
  • Button font: 16px, weight 600–700
  • Button label: verb + outcome (“Start checkout”, “Get the guide”)
  • Primary action: exactly one dominant CTA per screen

Links (prevent “looks like text” failure)

  • Links are always underlined by default.
  • Never style links as plain body text.
  • If you use blue for CTA, keep links blue but underlined, and keep CTA as a filled button.

Forms and Validation

Forms are where intent dies. Your job is to remove work and remove uncertainty.

  • Layout: one column
  • Input height: 48px
  • Label: always visible, above input
  • Help text: 13px, placed under label
  • Field spacing: 16px
  • Error message: 13px, plain language, directly under the field
  • Inline validation: validate on blur, not on every keystroke
Field states (visual)
Email
name@domain.com
We’ll send a receipt here.
Card number
•••• •••• •••• 1234
Payment failed. Try another card.
Promo code
WELCOME10
Focus ring must be obvious.

Error message format (fastest recovery)

What happened: “Payment failed.”
Why: “Your bank declined the transaction.”
Fix: “Try another card.”
Safety: “Your cart is saved.”

Core Components

Components must be predictable. Predictability reduces decision cost.

Cards

  • Padding: 24px
  • Radius: 12px
  • Border: 1px #E5E7EB
  • Clickable card: entire card is clickable, not only the title
  • Hierarchy: title → one-line explanation → one clear action

Modals

  • Use only for confirmations or short tasks.
  • Provide a visible close button.
  • ESC closes, focus is trapped inside, focus returns on close.
  • Never stack modals.

Cards (visual)

Card title
One sentence that explains value. No fluff.
One clear action
Clickable card
Make the entire area interactive, not just the headline.

Tables (data UI)

  • Row height: 48px
  • Header: sticky for long tables
  • Mobile: horizontal scroll, do not crush columns
  • Alignment: text left, numbers right

Loading, Empty, Error, Success

Missing states reduce trust instantly. Reduced trust reduces clicks.

Loading
Skeleton for page content. Spinner for short actions.
Empty
No saved items yet. Add your first one to get started.
Add item
Error
Payment failed.
Your bank declined the transaction. Try another card. Your cart is saved.
Try another card
Success
Saved. Next: share it with your team.
Share

Motion and Micro-interactions

Motion should reduce confusion. If it does not reduce confusion, remove it.

  • Small transitions: 120–200ms
  • Large panels: 250–300ms
  • Tap feedback: visible within 100ms
  • Reduce motion: respect OS settings

Accessibility Baselines

Accessibility is performance. If people struggle, they don’t click.

  • Text contrast: meet WCAG minimum for normal text
  • UI component contrast: borders/icons remain visible
  • Touch targets: design for 48×48 on key actions (WCAG 2.2 minimum is 24×24 with exceptions)
  • Keyboard: everything interactive must work
  • Focus: visible focus ring, never removed
  • States: don’t rely on color alone for meaning

CRO Rules That Move CTR

CTR rises when the user can decide fast. Your job is to reduce decision cost.

  • One dominant CTA: one button that visually wins.
  • CTA copy: “what happens next” in 2–4 words.
  • Space around CTA: isolate it with whitespace.
  • Remove competing actions: above the fold, keep navigation minimal.
  • Trust clarity: remove surprises (price, commitment, next step).
  • Speed: fix slow pages. Slow pages leak intent.

Speed is CRO

  • INP: aim ≤ 200ms at p75 (responsiveness)
  • CLS: avoid layout shift (reserve image space)
  • Fonts: swap + stable fallbacks
  • Rule: “fast enough” beats “pretty later”

Pre-Ship Checklist

  • Primary action is obvious in 3 seconds.
  • CTA is the most dominant element on screen.
  • All interactive elements have hover/focus/pressed/disabled states.
  • Links look like links (underlined).
  • Forms are one-column and errors are recoverable.
  • Minimum touch targets are respected everywhere.
  • Contrast is compliant for text and components.
  • Pages load fast and do not shift layout.
  • Responsive at breakpoints (especially ≤480px).
  • Core Web Vitals are not ignored.

Sources