
Swiftui Design Principles
Polish SwiftUI screens and WidgetKit widgets so spacing, type, and color feel native instead of generic AI UI slop.
Install
npx skills add https://github.com/arjitj2/swiftui-design-principles --skill swiftui-design-principlesWhat is this skill?
- Restraint-over-decoration philosophy with fewer, consistent spacing and type tokens
- WidgetKit guidance alongside SwiftUI views for native-feeling widgets
- Copy discipline: one headline plus compact support instead of scattered rationale
- System colors and native components over custom gradients and decorative chrome
- Derived from comparing production SwiftUI apps against poorly spaced AI-built UIs
Adoption & trust: 687 installs on skills.sh; 13 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Vercel React Native Skillsvercel-labs/agent-skills
Firebase Basicsfirebase/agent-skills
Building Native Uiexpo/skills
Firebase Ai Logic Basicsfirebase/agent-skills
Native Data Fetchingexpo/skills
Firebase Firestorefirebase/agent-skills
Journey fit
Primary fit
Canonical shelf is Build because the skill applies while implementing native Apple interfaces, not while discovering markets or shipping CI. Frontend subphase matches view-level SwiftUI and WidgetKit work where spacing, typography, and system colors are decided.
Common Questions / FAQ
Is Swiftui Design Principles safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Swiftui Design Principles
This skill encodes design principles derived from comparing polished, production-quality SwiftUI apps against poorly-built ones. The patterns here represent what separates an app that feels "right" from one where the margins, spacing, and text sizes just look "off." Apply these principles whenever building or modifying SwiftUI interfaces, WidgetKit widgets, or any native Apple UI. ## Core Philosophy **Restraint over decoration.** Every pixel must earn its place. A polished app uses fewer colors, fewer font sizes, fewer spacing values, and fewer words — but uses them consistently. Over-engineering visual elements (custom gradients, decorative borders, bespoke dividers) creates visual noise. Native components and system colors create harmony. **Attention is scarce.** Keep UI copy shorter than you think it needs to be. Prefer one clear headline and one compact supporting block over repeated explanation in the title, subtitle, body, and footer. If a screen needs rationale, put it in one purposeful place instead of scattering it across the page. --- ## 1. Spacing System: Use a Consistent Grid **CRITICAL**: Use spacing values from a base-4/base-8 grid. Never use arbitrary values. ### Allowed spacing values ``` 4, 8, 12, 16, 20, 24, 32, 40, 48 ``` ### Bad (arbitrary values that create visual dissonance) ```swift // WRONG - these numbers have no relationship to each other .padding(.bottom, 26) .padding(.bottom, 34) .padding(.bottom, 36) HStack(spacing: 18) .padding(14) ``` ### Good (values from a consistent grid) ```swift // RIGHT - predictable rhythm the eye can follow .padding(.horizontal, 20) .padding(.top, 8) Spacer().frame(height: 32) HStack(spacing: 4) // or 8, 12, 16 .padding(.vertical, 12) .padding(.horizontal, 16) ``` ### Standard padding assignments - **Outer content padding**: 16-20pt horizontal - **Between major sections**: 24-32pt vertical - **Within grouped components**: 4-12pt - **Card/row internal padding**: 12-16pt vertical, 16pt horizontal --- ## 2. Typography: Hierarchy Through Weight, Not Just Size ### The principle Use **fewer font sizes** with **clear weight differentiation**. Lighter weights at larger sizes; medium/regular at smaller sizes. This creates sophistication rather than visual chaos. ### Recommended type scale (for a data-focused app) | Role | Size | Weight | Notes | |------|------|--------|-------| | Hero number | 36-42pt | `.light` | Large but visually light -- elegant, not heavy | | Secondary stat | 20-24pt | `.light` | Same weight family as hero, smaller | | Body / toggle label | 15pt | `.regular` | Standard iOS body size | | Section header (uppercase) | 11pt | `.medium` | With tracking/letter-spacing | | Caption / subtitle | 11-13pt | `.regular` | Secondary information | ### Bad (too many sizes, inconsistent weights) ```swift // WRONG - 7 different sizes with no clear system .font(.system(size: 60, weight: .ultraLight)) // hero .font(.system(size: 44, weight: .regular)) // stat (too close to hero) .font(.system(size: 31, weight: .ultraLight)) // percent symbol (odd ratio) .font(.system(size: 18, weight: .regular)) // label (too big for a toggle) .font(.system(size: 14, weight: .regular)) // header .font(.system(size: 13, weight: .regular)) // another header .font(.system(size: 12, weight: .regular)) // button (too small to read) ``` ### Good (clear hierarchy, fewer sizes) ```swift // RIGHT - 5 sizes, clear purpose for each .font(.system(size: 42, weight: .light, design: .monospaced)) // hero .font(.syste