AgentSkillsCN

ux-laws

基于用户体验法则,运用心理学原理与认知规律,打造直观易用的用户界面。

SKILL.md
--- frontmatter
title: UX Laws & Psychology
description: Psychological principles and cognitive laws for creating intuitive user interfaces based on Laws of UX
tags:
  - frontend
  - ux
  - psychology
  - cognitive-science
  - staylook
  - heuristics
  - gestalt
name: ux-laws

UX Laws & Psychology Skill

Based on Laws of UX: Psychological principles for building intuitive interfaces

What is it?

This skill provides essential psychological principles and cognitive laws that inform great user interface design. Understanding these laws helps create interfaces that align with how human brains naturally process information, make decisions, and perceive visual elements.

Why use it?

  • Psychology-Backed Design: Make decisions based on how humans actually think
  • Reduce Friction: Align interface with natural cognitive patterns
  • Increase Usability: Apply proven principles that improve task completion
  • Memorable Experiences: Design for how humans remember and perceive
  • Intuitive Interfaces: Match user expectations and mental models

Part 1: Core Laws Summary

Decision & Cognitive Load Laws

LawPrincipleStaylook Application
Hick's LawMore choices = slower decisions"One Highlight" reduces decision time
Miller's Law~7 items in working memoryCard layouts chunk information
Tesler's LawComplexity must exist somewhereShift complexity to the system
Occam's RazorSimplest solution is bestMinimal design philosophy

Perception & Attention Laws

LawPrincipleStaylook Application
Von Restorff EffectDifferent items are rememberedExpressive element stands out
Selective AttentionUsers filter stimuliStandard fades, Expressive captures focus
Serial PositionFirst/last items remembered bestPrimary actions at end (right)
Peak-End RuleExperiences judged by peak+endDelightful success states

Visual Organization Laws (Gestalt)

LawPrincipleStaylook Application
ProximityNear objects seem grouped4px spacing grid
Common RegionBounded elements groupedRadius hierarchy (32→24→16)
SimilaritySimilar styling = relatedAll buttons pill-shaped
Uniform ConnectednessConnected = relatedStep indicators with lines
PrägnanzPrefer simplest interpretationClean, minimal layouts

Interaction & Performance Laws

LawPrincipleStaylook Application
Fitts's LawBigger + closer = fasterPill buttons maximize area
Doherty ThresholdFeedback within 400ms150ms/300ms/500ms animation scale
Goal-Gradient EffectMotivation increases near goalExpressive for completed steps

User Expectation Laws

LawPrincipleStaylook Application
Jakob's LawUsers expect familiar patternsFamiliar patterns + curved aesthetic
Mental ModelsUsers have preexisting beliefsCards = contained, Pill = action
Postel's LawAccept varied input, consistent outputFlexible inputs, formatted display

Memory & Aesthetics Laws

LawPrincipleStaylook Application
Zeigarnik EffectIncomplete tasks rememberedProgress indicators, incomplete highlights
Working MemoryLimited capacityKeep context visible
Aesthetic-UsabilityBeautiful = perceived usablePremium curved aesthetic

Part 2: Applying Laws to Staylook

Von Restorff + One Highlight Rule

The "One Highlight" rule is the Von Restorff Effect in action:

Principle: When multiple similar objects are present, the different one is remembered.

Implementation:

  • Use Expressive (accent) for exactly 1 element per screen
  • All other elements use Standard (--color-text) color
  • The highlight element captures attention first
  • Don't rely on color alone—combine with size/shape

Hick's Law + Button Hierarchy

Reduce decision time through clear hierarchy:

Principle: Fewer choices = faster decisions.

Implementation:

  • ONE Expressive button (the obvious choice)
  • Standard buttons for secondary options
  • Ghost buttons for tertiary "maybe later" actions
  • Progressive disclosure for complex options

Fitts's Law + Pill Buttons

Optimize touch/click targets:

Principle: Larger and closer targets are easier to acquire.

Implementation:

  • All buttons are pill-shaped (maximizes area)
  • Minimum 44px touch target on mobile
  • Primary actions are visually larger
  • FAB buttons leverage corner advantage

Proximity + Spacing Grid

Group related elements:

Principle: Near elements are perceived as related.

Implementation:

  • space-2 (8px): Tightly related (label-input)
  • space-4 (16px): Related group members
  • space-8 (32px): Between groups
  • space-12+ (48px+): Between sections

Common Region + Radius Hierarchy

Create visual containers:

Principle: Bounded elements are perceived as grouped.

Implementation:

  • Section: 32px radius (outermost)
  • Container: 24px radius (major wrapper)
  • Card: 16px radius (information group)
  • Nesting: Outer more rounded than inner

Doherty Threshold + Animation Scale

Provide timely feedback:

Principle: Feedback must arrive within 400ms.

Implementation:

  • Fast (150ms): Micro-interactions, hovers
  • Base (300ms): Standard transitions
  • Slow (500ms): Complex animations
  • 400ms: Show loading skeleton/spinner


Part 3: Application Checklist

Cognitive Load

  • Limited choices per screen (Hick's Law)
  • Content chunked into groups (Miller's Law)
  • Complexity handled by system where possible (Tesler's Law)

Visual Perception

  • Key action visually distinctive (Von Restorff)
  • Important items at start/end of lists (Serial Position)
  • Related items grouped together (Proximity)
  • Containers define visual regions (Common Region)

Interaction

  • Touch targets sized appropriately—44px+ (Fitts's Law)
  • Feedback provided within 400ms (Doherty Threshold)
  • Familiar patterns used (Jakob's Law)

Experience

  • Peak moments are delightful (Peak-End Rule)
  • End moments are satisfying (Peak-End Rule)
  • Aesthetic quality maintained (Aesthetic-Usability)

Part 4: Best Practices

Do:

  • Apply multiple principles together (they reinforce each other)
  • Use Von Restorff for primary actions (Staylook's "One Highlight")
  • Respect Fitts's Law for button sizing and placement
  • Follow Jakob's Law for familiar patterns
  • Create delightful peak and end moments
  • Use proximity and common region for visual organization

Don't:

  • Overwhelm with choices (violates Hick's Law)
  • Make all elements equally prominent (violates Von Restorff)
  • Use tiny touch targets (violates Fitts's Law)
  • Invent unfamiliar navigation patterns (violates Jakob's Law)
  • End experiences on negative notes (violates Peak-End Rule)
  • Leave users waiting without feedback (violates Doherty Threshold)

Further Resources


UX Laws & Psychology Skill — Based on Laws of UX