Form UX Patterns
Patterns for complex forms based on cognitive load research and aviation UX principles.
Quick Start // Multi-step form with chunking import { useMultiStepForm } from './multi-step-form';
function CheckoutWizard() { const { currentStep, steps, goNext, goBack, isLastStep } = useMultiStepForm({ steps: [ { id: 'contact', title: 'Contact', fields: ['email', 'phone'] }, { id: 'shipping', title: 'Shipping', fields: ['name', 'street', 'city', 'state', 'zip'] }, { id: 'payment', title: 'Payment', fields: ['cardName', 'cardNumber', 'expiry', 'cvv'] } ] });
return (
); }Core Principles 1. Cognitive Chunking (Aviation Principle)
"Humans can hold 5-7 items in working memory" — Miller's Law
// ❌ BAD: All fields on one page
// ✅ GOOD: Chunked into logical groups (5-7 max per group)
- Briefing vs. Checklist (Aviation Principle)
Instructions should be separate from labels, given before the task.
// ❌ BAD: Instructions mixed with labels
// ✅ GOOD: Briefing before, label during
Create a strong password with:
- At least 8 characters
- Uppercase and lowercase letters
- At least one number
- Progressive Disclosure
Show only what's needed, when it's needed.
// Reveal fields based on selection function ShippingForm() { const [method, setMethod] = useState<'standard' | 'express' | 'pickup'>('standard');
return (