1---2name: ui3description: Design clear, consistent, and visually polished user interfaces.4---56## Visual Hierarchy78- One focal point per screen—eye knows where to go first9- Size, color, weight establish importance—primary action most prominent10- Group related elements—proximity implies relationship11- White space is not wasted space—breathing room aids scanning1213## Typography1415- Maximum 2-3 font families—more creates visual noise16- Clear size scale: title > heading > body > caption—distinct steps, not gradual17- Line height 1.4-1.6 for body text—too tight or loose hurts readability18- Line length 45-75 characters—prevents eye fatigue19- Left-align body text—centered only for short headings2021## Color Usage2223- Primary color for primary actions—one dominant brand color24- Semantic colors consistent: red=error, green=success, yellow=warning25- Don't rely on color alone—add icons, text, patterns for accessibility26- Neutral palette for most UI—color for emphasis, not everywhere27- Test color blindness scenarios—8% of men affected2829## Spacing System3031- Use consistent scale: 4px, 8px, 16px, 24px, 32px, 48px32- Apply same spacing for same relationships—all card padding equal33- More space around groups than within—visual grouping through proximity34- Generous padding on touch targets—44px minimum for mobile3536## Alignment3738- Grid system for consistency—8px or 4px base grid39- Align to invisible lines—elements share edges, not scattered40- Left edge strongest for LTR—anchor content predictably41- Optical alignment when needed—visual center differs from mathematical4243## Component States4445- Default, hover, active, focus, disabled—all states designed46- Focus state visible and clear—keyboard users need this47- Disabled looks disabled—reduced opacity, no pointer cursor48- Loading state replaces content—not just overlay49- Error state in context—red border, inline message5051## Icons5253- Consistent style throughout—don't mix outlined and filled54- Recognizable at small sizes—simple shapes work better55- Labels when meaning ambiguous—icon + text clearer than icon alone56- Touch target larger than visual icon—44px tap area, 24px icon5758## Imagery5960- Consistent aspect ratios—don't stretch or skew61- Fallback for failed loads—placeholder, not broken image62- Alt text for content images—decorative images alt=""63- Compress appropriately—quality vs file size balance6465## Responsive Design6667- Design for smallest screen first—enhance for larger68- Breakpoints based on content—not arbitrary device widths69- Touch targets larger on touch screens—hover states only on desktop70- Consider landscape orientation—especially for tablets7172## Dark Mode7374- Not just color inversion—redesign depth and emphasis75- Reduce contrast slightly—pure white on black strains eyes76- Shadows don't work same—use lighter surfaces for elevation77- Test all states—errors, success, charts, images78- Respect system preference—but allow override7980## Motion and Animation8182- Duration 150-300ms for transitions—fast but perceptible83- Ease-out for entering—starts fast, settles in84- Ease-in for exiting—accelerates out of view85- Consistent timing across similar interactions86- Purpose: guide attention, show relationships, provide feedback8788## Design Tokens8990- Define tokens for colors, spacing, typography—single source of truth91- Semantic naming: `color-error` not `color-red`92- Enables theming and dark mode—swap token values93- Scales with product—change once, update everywhere9495## Common Mistakes9697- Too many font sizes—stick to the scale98- Inconsistent spacing—creates unpolished feel99- Low contrast text—4.5:1 minimum for accessibility100- Buttons that don't look clickable—affordance matters101- Different styles for same component—cards should match cards