1---
2name: ui
3description: Design clear, consistent, and visually polished user interfaces.
4metadata:
5 source: https://skillmd.com/skills/modbender/ui
6 clawdbot:
7 emoji: 🎨
8 os:
9 - linux
10 - darwin
11 - win32
12---
13
14## Visual Hierarchy
15
16- One focal point per screen—eye knows where to go first
17- Size, color, weight establish importance—primary action most prominent
18- Group related elements—proximity implies relationship
19- White space is not wasted space—breathing room aids scanning
20
21## Typography
22
23- Maximum 2-3 font families—more creates visual noise
24- Clear size scale: title > heading > body > caption—distinct steps, not gradual
25- Line height 1.4-1.6 for body text—too tight or loose hurts readability
26- Line length 45-75 characters—prevents eye fatigue
27- Left-align body text—centered only for short headings
28
29## Color Usage
30
31- Primary color for primary actions—one dominant brand color
32- Semantic colors consistent: red=error, green=success, yellow=warning
33- Don't rely on color alone—add icons, text, patterns for accessibility
34- Neutral palette for most UI—color for emphasis, not everywhere
35- Test color blindness scenarios—8% of men affected
36
37## Spacing System
38
39- Use consistent scale: 4px, 8px, 16px, 24px, 32px, 48px
40- Apply same spacing for same relationships—all card padding equal
41- More space around groups than within—visual grouping through proximity
42- Generous padding on touch targets—44px minimum for mobile
43
44## Alignment
45
46- Grid system for consistency—8px or 4px base grid
47- Align to invisible lines—elements share edges, not scattered
48- Left edge strongest for LTR—anchor content predictably
49- Optical alignment when needed—visual center differs from mathematical
50
51## Component States
52
53- Default, hover, active, focus, disabled—all states designed
54- Focus state visible and clear—keyboard users need this
55- Disabled looks disabled—reduced opacity, no pointer cursor
56- Loading state replaces content—not just overlay
57- Error state in context—red border, inline message
58
59## Icons
60
61- Consistent style throughout—don't mix outlined and filled
62- Recognizable at small sizes—simple shapes work better
63- Labels when meaning ambiguous—icon + text clearer than icon alone
64- Touch target larger than visual icon—44px tap area, 24px icon
65
66## Imagery
67
68- Consistent aspect ratios—don't stretch or skew
69- Fallback for failed loads—placeholder, not broken image
70- Alt text for content images—decorative images alt=""
71- Compress appropriately—quality vs file size balance
72
73## Responsive Design
74
75- Design for smallest screen first—enhance for larger
76- Breakpoints based on content—not arbitrary device widths
77- Touch targets larger on touch screens—hover states only on desktop
78- Consider landscape orientation—especially for tablets
79
80## Dark Mode
81
82- Not just color inversion—redesign depth and emphasis
83- Reduce contrast slightly—pure white on black strains eyes
84- Shadows don't work same—use lighter surfaces for elevation
85- Test all states—errors, success, charts, images
86- Respect system preference—but allow override
87
88## Motion and Animation
89
90- Duration 150-300ms for transitions—fast but perceptible
91- Ease-out for entering—starts fast, settles in
92- Ease-in for exiting—accelerates out of view
93- Consistent timing across similar interactions
94- Purpose: guide attention, show relationships, provide feedback
95
96## Design Tokens
97
98- Define tokens for colors, spacing, typography—single source of truth
99- Semantic naming: `color-error` not `color-red`
100- Enables theming and dark mode—swap token values
101- Scales with product—change once, update everywhere
102
103## Common Mistakes
104
105- Too many font sizes—stick to the scale
106- Inconsistent spacing—creates unpolished feel
107- Low contrast text—4.5:1 minimum for accessibility
108- Buttons that don't look clickable—affordance matters
109- Different styles for same component—cards should match cards