Design Guide
Comprehensive design system ensuring every UI you build looks modern, professional, and consistent across all platforms (SwiftUI, Android Studio, web applications).
Bundled Resources
This skill includes additional reference materials:
- references/color-palettes.md - Detailed color schemes, accent color options, and platform-specific color implementation examples. Reference when choosing or implementing colors.
- references/component-templates.md - Ready-to-use code templates for buttons, cards, forms, and navigation across SwiftUI, Android Compose, and React. Reference when implementing specific components.
Core Design Principles
1. Clean and Minimal
- Embrace white space generously
- Avoid cluttered interfaces
- One primary action per screen/section
- Remove unnecessary decorative elements
- Let content breathe
2. Color Palette
Neutral Base:
- Use grays and off-whites as foundation
- White: #FFFFFF
- Light gray: #F5F5F5, #EEEEEE
- Medium gray: #9E9E9E, #757575
- Dark gray: #424242, #212121
- True black sparingly: #000000
Accent Color:
- Choose ONE accent color for your app
- Use sparingly for CTAs, important actions, and key information
- Good accent options: Emerald (#10B981), Indigo (#6366F1), Rose (#F43F5E), Amber (#F59E0B)
- NEVER use generic purple/blue gradients
Color Usage Rules:
- 80% neutral, 15% secondary neutral, 5% accent
- Backgrounds: light grays or white
- Text: dark grays on light backgrounds
- Interactive elements: accent color
- Borders/dividers: very light gray (#E5E5E5)
3. Spacing System (8px Grid)
Always use multiples of 8:
- 8px: Tight spacing (icon padding, inline elements)
- 16px: Standard spacing (button padding, form field gaps)
- 24px: Section spacing (card internal padding)
- 32px: Component spacing (between cards, sections)
- 48px: Major section breaks
- 64px: Screen-level spacing (margins)
Application:
- Padding: 16px or 24px for most containers
- Margins: 32px between major sections
- Gap between elements: 16px standard, 8px for tight groups
- Never use arbitrary values like 13px or 27px
4. Typography
Hierarchy:
- H1: 32px - 40px, bold, rare (page titles only)
- H2: 24px - 28px, semibold (section headers)
- H3: 20px - 24px, semibold (subsections)
- Body: 16px - 18px, regular (MINIMUM 16px for readability)
- Small: 14px, regular (captions, metadata)
- Tiny: 12px, regular (legal text only, use rarely)
Font Rules:
- Maximum 2 font families per project
- One for headings (can be display font)
- One for body text (must be highly readable)
- Recommended pairings:
- Inter + Inter (single family, different weights)
- SF Pro Display + SF Pro Text (Apple platforms)
- Roboto + Roboto (Android)
- System fonts always acceptable
Line Height:
- Headings: 1.2 - 1.3
- Body: 1.5 - 1.6
- Small text: 1.4
5. Shadows
Subtle, not heavy:
- Small shadow:
0 1px 3px rgba(0,0,0,0.12)
- Medium shadow:
0 4px 6px rgba(0,0,0,0.1)
- Large shadow:
0 10px 15px rgba(0,0,0,0.1)
- Floating shadow:
0 20px 25px rgba(0,0,0,0.1)
When to use:
- Cards: subtle shadow or border, not both
- Buttons: very subtle shadow on hover
- Modals/dialogs: medium shadow
- Dropdowns: medium shadow
- Avoid: heavy drop shadows, inner shadows, multiple shadows
6. Rounded Corners
Border Radius Guidelines:
- Small elements (buttons, inputs): 6px - 8px
- Cards, containers: 8px - 12px
- Large panels: 12px - 16px
- Circular (avatars, icon buttons): 50% or 9999px
Don't overdo it:
- Not everything needs rounded corners
- Sharp corners acceptable for:
- Screen edges
- Full-width sections
- Data tables
- Navigation bars
7. Interactive States
Every interactive element MUST have:
Buttons:
- Default: base color, subtle shadow
- Hover: slightly darker (10%), lift shadow
- Active: pressed appearance, darker (20%)
- Disabled: 40% opacity, no hover, no pointer cursor
- Focus: visible outline (2px accent color, 2px offset)
Form Fields:
- Default: light gray border (#E5E5E5)
- Focus: accent color border (2px), remove shadow
- Error: red border, error text below
- Disabled: gray background, no interaction
- Valid: subtle green checkmark (optional)
Links:
- Default: accent color, underline on hover
- Visited: slightly muted accent
- Never: blue #0000FF (unless that's your accent)
Cards:
- Default: subtle shadow or border
- Hover: lift effect, slightly stronger shadow
- Active: immediate feedback
8. Mobile-First Thinking
Always design for mobile first, then scale up:
- Touch targets minimum 44x44px (iOS), 48x48px (Android)
- Adequate spacing between tappable elements (min 8px)
- Thumb-friendly navigation (bottom of screen)
- Single column layouts on mobile
- Responsive breakpoints:
- Mobile: < 640px
- Tablet: 640px - 1024px
- Desktop: > 1024px
Component Patterns
Buttons
Primary Button (main action):
Background: Accent color
Text: White
Padding: 12px 24px (vertical, horizontal)
Border radius: 8px
Shadow: 0 1px 3px rgba(0,0,0,0.12)
Font: 16px, semibold
Hover: Darken 10%, lift shadow
Secondary Button (alternative action):
Background: White
Text: Accent color
Border: 1px solid accent color
Padding: 12px 24px
Border radius: 8px
Hover: Light accent background (10% opacity)
Ghost Button (tertiary action):
Background: Transparent
Text: Dark gray
No border
Padding: 12px 24px
Hover: Light gray background
Bad Button Examples:
- ❌ Gradient backgrounds
- ❌ Multiple colors in one button
- ❌ Tiny padding (looks cramped)
- ❌ No hover state
- ❌ Text too small (< 14px)
Cards
Standard Card:
Background: White
Border: 1px solid #E5E5E5 OR subtle shadow (not both)
Border radius: 12px
Padding: 24px
Margin bottom: 16px
OR
Background: White
Shadow: 0 4px 6px rgba(0,0,0,0.1)
Border radius: 12px
Padding: 24px
Margin bottom: 16px
Card Content Spacing:
- Title to subtitle: 8px
- Subtitle to content: 16px
- Content sections: 24px
- Content to actions: 24px
Bad Card Examples:
- ❌ Both border AND shadow
- ❌ Heavy shadows
- ❌ Inconsistent padding
- ❌ Too many colors
Forms
Form Field:
Label: 14px, semibold, dark gray, margin bottom 8px
Input:
- Height: 44px minimum
- Padding: 12px 16px
- Border: 1px solid #E5E5E5
- Border radius: 8px
- Background: White
- Font: 16px
- Focus: Accent border, no shadow
Error state:
- Border: Red
- Helper text: Red, 14px, margin top 4px
Field spacing: 24px between fields
Form Layout:
- Labels above inputs (not beside)
- Clear required indicators
- Group related fields
- Adequate spacing (24px minimum)
- Submit button: full width on mobile, auto on desktop
Bad Form Examples:
- ❌ Labels inside inputs (placeholder text is not a label)
- ❌ Tiny text (< 16px)
- ❌ Cramped spacing
- ❌ No error states
- ❌ Unclear required fields
Navigation
Top Navigation:
Height: 64px
Background: White
Border bottom: 1px solid #E5E5E5
Padding: 0 32px (desktop), 0 16px (mobile)
Logo: 32px height
Links: 16px, medium weight, dark gray
Active link: Accent color
Bottom Navigation (Mobile):
Height: 56px
Background: White
Shadow: 0 -4px 6px rgba(0,0,0,0.1)
Icons: 24px, centered
Labels: 12px (optional)
Active: Accent color
Design Quality Checklist
Before considering any UI complete, verify:
Layout:
Colors:
Typography:
Interactive Elements:
Components:
Mobile:
Platform-Specific Notes
SwiftUI
- Use
.padding() with explicit values from 8px grid
- Use
Color with hex initializers for consistent colors
- Leverage
@Environment(\.colorScheme) for dark mode
- Use SF Symbols for icons (always consistent)
Android Studio
- Use
dp units (1dp ≈ 1px on mdpi)
- Material Design 3 components acceptable but customize colors
- Use
dimens.xml for spacing constants
- Leverage Compose for modern UI
Web (HTML/CSS/React)
- Use CSS variables for colors and spacing
- Mobile-first media queries
- Use semantic HTML
- Leverage Tailwind CSS classes following this guide
Anti-Patterns to Avoid
NEVER do these:
- ❌ Rainbow gradients everywhere
- ❌ Different colors on every element
- ❌ Purple/blue gradients by default
- ❌ Tiny unreadable text (< 16px body)
- ❌ Inconsistent spacing (random values)
- ❌ Heavy drop shadows
- ❌ Overly rounded everything
- ❌ Missing interactive states
- ❌ Both borders AND shadows on same element
- ❌ Cluttered layouts with no white space
- ❌ More than 2 font families
- ❌ Touch targets smaller than 44px
Quick Reference
Spacing: 8, 16, 24, 32, 48, 64px
Typography: 16px minimum body, max 2 fonts
Colors: Neutral base + ONE accent
Shadows: Subtle only
Border radius: 6-12px most elements
Interactive states: Always include hover, active, disabled, focus
Always reference this guide before creating any UI component. Consistency is key to professional design.
1---2name: design-guide3description: Ensures modern, professional UI design across SwiftUI, Android, and web platforms. Use when building ANY user interface components including buttons, forms, cards, layouts, navigation, or complete screens. Enforces clean minimal design, neutral color palettes with one accent color, 8px grid spacing system, proper typography hierarchy, and clear interactive states. Always reference before creating or modifying UI elements.4---5
6# Design Guide
7
8Comprehensive design system ensuring every UI you build looks modern, professional, and consistent across all platforms (SwiftUI, Android Studio, web applications).
9
10## Bundled Resources
11
12This skill includes additional reference materials:
13
14- **references/color-palettes.md** - Detailed color schemes, accent color options, and platform-specific color implementation examples. Reference when choosing or implementing colors.
15- **references/component-templates.md** - Ready-to-use code templates for buttons, cards, forms, and navigation across SwiftUI, Android Compose, and React. Reference when implementing specific components.
16
17## Core Design Principles
18
19### 1. Clean and Minimal
20- Embrace white space generously
21- Avoid cluttered interfaces
22- One primary action per screen/section
23- Remove unnecessary decorative elements
24- Let content breathe
25
26### 2. Color Palette
27
28**Neutral Base:**
29- Use grays and off-whites as foundation
30- White: #FFFFFF
31- Light gray: #F5F5F5, #EEEEEE
32- Medium gray: #9E9E9E, #757575
33- Dark gray: #424242, #212121
34- True black sparingly: #000000
35
36**Accent Color:**
37- Choose ONE accent color for your app
38- Use sparingly for CTAs, important actions, and key information
39- Good accent options: Emerald (#10B981), Indigo (#6366F1), Rose (#F43F5E), Amber (#F59E0B)
40- **NEVER use generic purple/blue gradients**
41
42**Color Usage Rules:**
43- 80% neutral, 15% secondary neutral, 5% accent
44- Backgrounds: light grays or white
45- Text: dark grays on light backgrounds
46- Interactive elements: accent color
47- Borders/dividers: very light gray (#E5E5E5)
48
49### 3. Spacing System (8px Grid)
50
51**Always use multiples of 8:**
52- 8px: Tight spacing (icon padding, inline elements)
53- 16px: Standard spacing (button padding, form field gaps)
54- 24px: Section spacing (card internal padding)
55- 32px: Component spacing (between cards, sections)
56- 48px: Major section breaks
57- 64px: Screen-level spacing (margins)
58
59**Application:**
60- Padding: 16px or 24px for most containers
61- Margins: 32px between major sections
62- Gap between elements: 16px standard, 8px for tight groups
63- Never use arbitrary values like 13px or 27px
64
65### 4. Typography
66
67**Hierarchy:**
68- H1: 32px - 40px, bold, rare (page titles only)
69- H2: 24px - 28px, semibold (section headers)
70- H3: 20px - 24px, semibold (subsections)
71- Body: 16px - 18px, regular (MINIMUM 16px for readability)
72- Small: 14px, regular (captions, metadata)
73- Tiny: 12px, regular (legal text only, use rarely)
74
75**Font Rules:**
76- Maximum 2 font families per project
77- One for headings (can be display font)
78- One for body text (must be highly readable)
79- Recommended pairings:
80 - Inter + Inter (single family, different weights)
81 - SF Pro Display + SF Pro Text (Apple platforms)
82 - Roboto + Roboto (Android)
83 - System fonts always acceptable
84
85**Line Height:**
86- Headings: 1.2 - 1.3
87- Body: 1.5 - 1.6
88- Small text: 1.4
89
90### 5. Shadows
91
92**Subtle, not heavy:**
93- Small shadow: `0 1px 3px rgba(0,0,0,0.12)`
94- Medium shadow: `0 4px 6px rgba(0,0,0,0.1)`
95- Large shadow: `0 10px 15px rgba(0,0,0,0.1)`
96- Floating shadow: `0 20px 25px rgba(0,0,0,0.1)`
97
98**When to use:**
99- Cards: subtle shadow or border, not both
100- Buttons: very subtle shadow on hover
101- Modals/dialogs: medium shadow
102- Dropdowns: medium shadow
103- **Avoid:** heavy drop shadows, inner shadows, multiple shadows
104
105### 6. Rounded Corners
106
107**Border Radius Guidelines:**
108- Small elements (buttons, inputs): 6px - 8px
109- Cards, containers: 8px - 12px
110- Large panels: 12px - 16px
111- Circular (avatars, icon buttons): 50% or 9999px
112
113**Don't overdo it:**
114- Not everything needs rounded corners
115- Sharp corners acceptable for:
116 - Screen edges
117 - Full-width sections
118 - Data tables
119 - Navigation bars
120
121### 7. Interactive States
122
123**Every interactive element MUST have:**
124
125**Buttons:**
126- Default: base color, subtle shadow
127- Hover: slightly darker (10%), lift shadow
128- Active: pressed appearance, darker (20%)
129- Disabled: 40% opacity, no hover, no pointer cursor
130- Focus: visible outline (2px accent color, 2px offset)
131
132**Form Fields:**
133- Default: light gray border (#E5E5E5)
134- Focus: accent color border (2px), remove shadow
135- Error: red border, error text below
136- Disabled: gray background, no interaction
137- Valid: subtle green checkmark (optional)
138
139**Links:**
140- Default: accent color, underline on hover
141- Visited: slightly muted accent
142- Never: blue #0000FF (unless that's your accent)
143
144**Cards:**
145- Default: subtle shadow or border
146- Hover: lift effect, slightly stronger shadow
147- Active: immediate feedback
148
149### 8. Mobile-First Thinking
150
151**Always design for mobile first, then scale up:**
152- Touch targets minimum 44x44px (iOS), 48x48px (Android)
153- Adequate spacing between tappable elements (min 8px)
154- Thumb-friendly navigation (bottom of screen)
155- Single column layouts on mobile
156- Responsive breakpoints:
157 - Mobile: < 640px
158 - Tablet: 640px - 1024px
159 - Desktop: > 1024px
160
161## Component Patterns
162
163### Buttons
164
165**Primary Button (main action):**
166```
167Background: Accent color
168Text: White
169Padding: 12px 24px (vertical, horizontal)
170Border radius: 8px
171Shadow: 0 1px 3px rgba(0,0,0,0.12)
172Font: 16px, semibold
173Hover: Darken 10%, lift shadow
174```
175
176**Secondary Button (alternative action):**
177```
178Background: White
179Text: Accent color
180Border: 1px solid accent color
181Padding: 12px 24px
182Border radius: 8px
183Hover: Light accent background (10% opacity)
184```
185
186**Ghost Button (tertiary action):**
187```
188Background: Transparent
189Text: Dark gray
190No border
191Padding: 12px 24px
192Hover: Light gray background
193```
194
195**Bad Button Examples:**
196- ❌ Gradient backgrounds
197- ❌ Multiple colors in one button
198- ❌ Tiny padding (looks cramped)
199- ❌ No hover state
200- ❌ Text too small (< 14px)
201
202### Cards
203
204**Standard Card:**
205```
206Background: White
207Border: 1px solid #E5E5E5 OR subtle shadow (not both)
208Border radius: 12px
209Padding: 24px
210Margin bottom: 16px
211
212OR
213
214Background: White
215Shadow: 0 4px 6px rgba(0,0,0,0.1)
216Border radius: 12px
217Padding: 24px
218Margin bottom: 16px
219```
220
221**Card Content Spacing:**
222- Title to subtitle: 8px
223- Subtitle to content: 16px
224- Content sections: 24px
225- Content to actions: 24px
226
227**Bad Card Examples:**
228- ❌ Both border AND shadow
229- ❌ Heavy shadows
230- ❌ Inconsistent padding
231- ❌ Too many colors
232
233### Forms
234
235**Form Field:**
236```
237Label: 14px, semibold, dark gray, margin bottom 8px
238Input:
239 - Height: 44px minimum
240 - Padding: 12px 16px
241 - Border: 1px solid #E5E5E5
242 - Border radius: 8px
243 - Background: White
244 - Font: 16px
245 - Focus: Accent border, no shadow
246
247Error state:
248 - Border: Red
249 - Helper text: Red, 14px, margin top 4px
250
251Field spacing: 24px between fields
252```
253
254**Form Layout:**
255- Labels above inputs (not beside)
256- Clear required indicators
257- Group related fields
258- Adequate spacing (24px minimum)
259- Submit button: full width on mobile, auto on desktop
260
261**Bad Form Examples:**
262- ❌ Labels inside inputs (placeholder text is not a label)
263- ❌ Tiny text (< 16px)
264- ❌ Cramped spacing
265- ❌ No error states
266- ❌ Unclear required fields
267
268### Navigation
269
270**Top Navigation:**
271```
272Height: 64px
273Background: White
274Border bottom: 1px solid #E5E5E5
275Padding: 0 32px (desktop), 0 16px (mobile)
276Logo: 32px height
277Links: 16px, medium weight, dark gray
278Active link: Accent color
279```
280
281**Bottom Navigation (Mobile):**
282```
283Height: 56px
284Background: White
285Shadow: 0 -4px 6px rgba(0,0,0,0.1)
286Icons: 24px, centered
287Labels: 12px (optional)
288Active: Accent color
289```
290
291## Design Quality Checklist
292
293Before considering any UI complete, verify:
294
295**Layout:**
296- [ ] Adequate white space throughout
297- [ ] Consistent spacing using 8px grid
298- [ ] Not cluttered or cramped
299- [ ] Clear visual hierarchy
300
301**Colors:**
302- [ ] Neutral base colors (grays/whites)
303- [ ] Only ONE accent color
304- [ ] NO gradients (unless specifically requested)
305- [ ] Sufficient contrast (WCAG AA minimum)
306
307**Typography:**
308- [ ] Clear hierarchy (size + weight)
309- [ ] Body text minimum 16px
310- [ ] Maximum 2 font families
311- [ ] Readable line heights
312
313**Interactive Elements:**
314- [ ] Clear hover states
315- [ ] Clear active states
316- [ ] Clear disabled states
317- [ ] Clear focus states (keyboard navigation)
318
319**Components:**
320- [ ] Buttons have proper padding
321- [ ] Forms have clear labels and spacing
322- [ ] Cards use border OR shadow, not both
323- [ ] Shadows are subtle
324
325**Mobile:**
326- [ ] Touch targets minimum 44x44px
327- [ ] Works on small screens
328- [ ] Adequate spacing for touch
329
330## Platform-Specific Notes
331
332### SwiftUI
333- Use `.padding()` with explicit values from 8px grid
334- Use `Color` with hex initializers for consistent colors
335- Leverage `@Environment(\.colorScheme)` for dark mode
336- Use SF Symbols for icons (always consistent)
337
338### Android Studio
339- Use `dp` units (1dp ≈ 1px on mdpi)
340- Material Design 3 components acceptable but customize colors
341- Use `dimens.xml` for spacing constants
342- Leverage Compose for modern UI
343
344### Web (HTML/CSS/React)
345- Use CSS variables for colors and spacing
346- Mobile-first media queries
347- Use semantic HTML
348- Leverage Tailwind CSS classes following this guide
349
350## Anti-Patterns to Avoid
351
352**NEVER do these:**
353- ❌ Rainbow gradients everywhere
354- ❌ Different colors on every element
355- ❌ Purple/blue gradients by default
356- ❌ Tiny unreadable text (< 16px body)
357- ❌ Inconsistent spacing (random values)
358- ❌ Heavy drop shadows
359- ❌ Overly rounded everything
360- ❌ Missing interactive states
361- ❌ Both borders AND shadows on same element
362- ❌ Cluttered layouts with no white space
363- ❌ More than 2 font families
364- ❌ Touch targets smaller than 44px
365
366## Quick Reference
367
368**Spacing:** 8, 16, 24, 32, 48, 64px
369**Typography:** 16px minimum body, max 2 fonts
370**Colors:** Neutral base + ONE accent
371**Shadows:** Subtle only
372**Border radius:** 6-12px most elements
373**Interactive states:** Always include hover, active, disabled, focus
374
375Always reference this guide before creating any UI component. Consistency is key to professional design.