Airbnb iOS Design System Best Practices
Opinionated, strict design system engineering for SwiftUI iOS 26 / Swift 6.2 apps. Contains 50 rules across 8 categories, prioritized by impact. Derived from Airbnb's Design Language System (DLS), Airbnb Swift Style Guide, Apple Human Interface Guidelines, and WWDC sessions. Mandates @Equatable on every view, @Observable for state, and style protocols as the primary component API.
Mandated Architecture Alignment
This skill is designed to work alongside swift-ui-architect. All code examples follow the same non-negotiable constraints:
- Feature modules depend on
Domain + DesignSystem; no direct Data dependency
@Observable for mutable UI state, ObservableObject / @Published never
@Equatable macro on every view
- Style protocols as the primary component styling API (Airbnb DLS pattern)
- Asset catalog as the source of truth for color values
- Local SPM package for design system module boundary
Scope & Relationship to Sibling Skills
This skill is the infrastructure layer — it teaches how to BUILD the design system itself. When loaded alongside sibling skills:
| Sibling Skill |
Its Focus |
This Skill's Focus |
swift-ui-architect |
Architecture (modular MVVM-C, route shells, protocol boundaries) |
Design system infrastructure (tokens, styles, governance) |
ios-design |
Using design primitives (semantic colors, typography) |
Engineering the token system that provides those primitives |
ios-ui-refactor |
Auditing/fixing visual quality issues |
Preventing those issues via governance and automation |
ios-hig |
HIG compliance patterns |
Asset and component infrastructure that makes compliance easy |
Clinic Architecture Contract (iOS 26 / Swift 6.2)
All guidance in this skill assumes the clinic modular MVVM-C architecture:
- Feature modules import
Domain + DesignSystem only (never Data, never sibling features)
- App target is the convergence point and owns
DependencyContainer, concrete coordinators, and Route Shell wiring
Domain stays pure Swift and defines models plus repository, *Coordinating, ErrorRouting, and AppError contracts
Data owns SwiftData/network/sync/retry/background I/O and implements Domain protocols
- Read/write flow defaults to stale-while-revalidate reads and optimistic queued writes
- ViewModels call repository protocols directly (no default use-case/interactor layer)
When to Apply
Reference these guidelines when:
- Setting up a design system for a new iOS app
- Building token architecture (colors, typography, spacing, sizing)
- Creating reusable component styles (ButtonStyle, LabelStyle, custom DLS protocols)
- Organizing asset catalogs (colors, images, icons)
- Migrating from ad-hoc styles to a governed token system
- Preventing style drift and enforcing consistency via automation
- Building theming infrastructure for whitelabel or multi-brand apps
- Reviewing PRs for ungoverned colors, hardcoded values, or shadow tokens
Rule Categories by Priority
| Priority |
Category |
Impact |
Prefix |
Rules |
| 1 |
Token Architecture |
CRITICAL |
token- |
6 |
| 2 |
Color System Engineering |
CRITICAL |
color- |
7 |
| 3 |
Component Style Library |
CRITICAL |
style- |
10 |
| 4 |
Typography Scale |
HIGH |
type- |
5 |
| 5 |
Spacing & Sizing System |
HIGH |
space- |
5 |
| 6 |
Consistency & Governance |
HIGH |
govern- |
7 |
| 7 |
Asset Management |
MEDIUM-HIGH |
asset- |
5 |
| 8 |
Theme & Brand Infrastructure |
MEDIUM |
theme- |
5 |
Quick Reference
1. Token Architecture (CRITICAL)
token-three-layer-hierarchy - Use Raw → Semantic → Component token layers
token-enum-over-struct - Use caseless enums for token namespaces
token-single-file-per-domain - One token file per design domain
token-shapestyle-extensions - Extend ShapeStyle for dot-syntax colors
token-asset-catalog-source - Source color tokens from asset catalog
token-avoid-over-abstraction - Avoid over-abstracting beyond three layers
2. Color System Engineering (CRITICAL)
color-organized-xcassets - Organize color assets with folder groups by role
color-complete-pairs - Define both appearances for every custom color
color-limit-palette - Limit custom colors to under 20 semantic tokens
color-no-hex-in-views - Never use Color literals or hex in view code
color-system-first - Prefer system colors before custom tokens
color-tint-not-brand-everywhere - Set brand color as app tint, don't scatter it
color-audit-script - Audit for ungoverned colors with a build script
3. Component Style Library (CRITICAL)
style-dls-protocol-pattern - Define custom style protocols for complex DLS components
style-equatable-views - Apply @Equatable to every design system view
style-accessibility-first - Build accessibility into style protocols, not individual views
style-protocol-over-wrapper - Use Style protocols instead of wrapper views
style-static-member-syntax - Provide static member syntax for custom styles
style-environment-awareness - Make styles responsive to environment values
style-view-for-containers-modifier-for-styling - Views for containers, modifiers for styling
style-catalog-file - One style catalog file per component type
style-configuration-over-parameters - Prefer configuration structs over many parameters
style-preview-catalog - Create a preview catalog for all styles
4. Typography Scale (HIGH)
type-scale-enum - Define a type scale enum wrapping system styles
type-system-styles-first - Use system text styles before custom ones
type-custom-font-registration - Register custom fonts with a centralized extension
type-max-styles-per-screen - Limit typography variations to 3-4 per screen
type-avoid-font-design-mixing - Use one font design per app
5. Spacing & Sizing System (HIGH)
space-token-enum - Define spacing tokens as a caseless enum
space-radius-tokens - Define corner radius tokens by component type
space-no-magic-numbers - Zero hardcoded numbers in view layout code
space-insets-pattern - Use EdgeInsets constants for composite padding
space-size-tokens - Define size tokens for common dimensions
6. Consistency & Governance (HIGH)
govern-naming-conventions - Enforce consistent naming conventions across all tokens
govern-spm-package-boundary - Isolate the design system as a local SPM package
govern-single-source-of-truth - Every visual value has one definition point
govern-lint-for-tokens - Use SwiftLint rules to enforce token usage
govern-design-system-directory - Isolate tokens in a dedicated directory
govern-migration-incremental - Migrate to tokens incrementally
govern-prevent-local-tokens - Prevent feature modules from defining local tokens
7. Asset Management (MEDIUM-HIGH)
asset-separate-catalogs - Separate asset catalogs for colors, images, icons
asset-sf-symbols-first - Use SF Symbols before custom icons
asset-icon-export-format - Use PDF/SVG vectors, never multiple PNGs
asset-image-optimization - Use compression and on-demand resources
asset-naming-convention - Consistent naming convention for all assets
8. Theme & Brand Infrastructure (MEDIUM)
theme-environment-key - Use EnvironmentKey for theme propagation
theme-dont-over-theme - Avoid building a theme system unless needed
theme-tint-for-brand - Use .tint() as primary brand expression
theme-light-dark-only - Use ColorScheme for light/dark, not custom theming
theme-brand-layer-separation - Separate brand identity from system mechanics
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
Reference Files
| File |
Description |
| references/_sections.md |
Category definitions and ordering |
| assets/templates/_template.md |
Template for new rules |
| metadata.json |
Version and reference information |
1---2name: ios-design-system3description: Clinic-architecture-aligned iOS design system engineering for SwiftUI (iOS 26 / Swift 6.2) covering token architecture, color/typography/spacing systems, component style libraries, asset governance, and theming. Enforces @Equatable on views and keeps design-system usage compatible with Feature-to-Domain+DesignSystem boundaries. Use when building or refactoring DesignSystem infrastructure for the clinic modular MVVM-C stack.4---5
6# Airbnb iOS Design System Best Practices
7
8Opinionated, strict design system engineering for SwiftUI iOS 26 / Swift 6.2 apps. Contains 50 rules across 8 categories, prioritized by impact. Derived from Airbnb's Design Language System (DLS), Airbnb Swift Style Guide, Apple Human Interface Guidelines, and WWDC sessions. Mandates @Equatable on every view, @Observable for state, and style protocols as the primary component API.
9
10## Mandated Architecture Alignment
11
12This skill is designed to work alongside `swift-ui-architect`. All code examples follow the same non-negotiable constraints:
13
14- Feature modules depend on `Domain` + `DesignSystem`; no direct `Data` dependency
15- `@Observable` for mutable UI state, `ObservableObject` / `@Published` never
16- `@Equatable` macro on every view
17- Style protocols as the primary component styling API (Airbnb DLS pattern)
18- Asset catalog as the source of truth for color values
19- Local SPM package for design system module boundary
20
21## Scope & Relationship to Sibling Skills
22
23This skill is the **infrastructure layer** — it teaches how to BUILD the design system itself. When loaded alongside sibling skills:
24
25| Sibling Skill | Its Focus | This Skill's Focus |
26|---------------|-----------|-------------------|
27| `swift-ui-architect` | **Architecture** (modular MVVM-C, route shells, protocol boundaries) | **Design system infrastructure** (tokens, styles, governance) |
28| `ios-design` | **Using** design primitives (semantic colors, typography) | **Engineering** the token system that provides those primitives |
29| `ios-ui-refactor` | **Auditing/fixing** visual quality issues | **Preventing** those issues via governance and automation |
30| `ios-hig` | **HIG compliance** patterns | **Asset and component infrastructure** that makes compliance easy |
31
32
33## Clinic Architecture Contract (iOS 26 / Swift 6.2)
34
35All guidance in this skill assumes the clinic modular MVVM-C architecture:
36
37- Feature modules import `Domain` + `DesignSystem` only (never `Data`, never sibling features)
38- App target is the convergence point and owns `DependencyContainer`, concrete coordinators, and Route Shell wiring
39- `Domain` stays pure Swift and defines models plus repository, `*Coordinating`, `ErrorRouting`, and `AppError` contracts
40- `Data` owns SwiftData/network/sync/retry/background I/O and implements Domain protocols
41- Read/write flow defaults to stale-while-revalidate reads and optimistic queued writes
42- ViewModels call repository protocols directly (no default use-case/interactor layer)
43
44## When to Apply
45
46Reference these guidelines when:
47- Setting up a design system for a new iOS app
48- Building token architecture (colors, typography, spacing, sizing)
49- Creating reusable component styles (ButtonStyle, LabelStyle, custom DLS protocols)
50- Organizing asset catalogs (colors, images, icons)
51- Migrating from ad-hoc styles to a governed token system
52- Preventing style drift and enforcing consistency via automation
53- Building theming infrastructure for whitelabel or multi-brand apps
54- Reviewing PRs for ungoverned colors, hardcoded values, or shadow tokens
55
56## Rule Categories by Priority
57
58| Priority | Category | Impact | Prefix | Rules |
59|----------|----------|--------|--------|-------|
60| 1 | Token Architecture | CRITICAL | `token-` | 6 |
61| 2 | Color System Engineering | CRITICAL | `color-` | 7 |
62| 3 | Component Style Library | CRITICAL | `style-` | 10 |
63| 4 | Typography Scale | HIGH | `type-` | 5 |
64| 5 | Spacing & Sizing System | HIGH | `space-` | 5 |
65| 6 | Consistency & Governance | HIGH | `govern-` | 7 |
66| 7 | Asset Management | MEDIUM-HIGH | `asset-` | 5 |
67| 8 | Theme & Brand Infrastructure | MEDIUM | `theme-` | 5 |
68
69## Quick Reference
70
71### 1. Token Architecture (CRITICAL)
72
73- [`token-three-layer-hierarchy`](references/token-three-layer-hierarchy.md) - Use Raw → Semantic → Component token layers
74- [`token-enum-over-struct`](references/token-enum-over-struct.md) - Use caseless enums for token namespaces
75- [`token-single-file-per-domain`](references/token-single-file-per-domain.md) - One token file per design domain
76- [`token-shapestyle-extensions`](references/token-shapestyle-extensions.md) - Extend ShapeStyle for dot-syntax colors
77- [`token-asset-catalog-source`](references/token-asset-catalog-source.md) - Source color tokens from asset catalog
78- [`token-avoid-over-abstraction`](references/token-avoid-over-abstraction.md) - Avoid over-abstracting beyond three layers
79
80### 2. Color System Engineering (CRITICAL)
81
82- [`color-organized-xcassets`](references/color-organized-xcassets.md) - Organize color assets with folder groups by role
83- [`color-complete-pairs`](references/color-complete-pairs.md) - Define both appearances for every custom color
84- [`color-limit-palette`](references/color-limit-palette.md) - Limit custom colors to under 20 semantic tokens
85- [`color-no-hex-in-views`](references/color-no-hex-in-views.md) - Never use Color literals or hex in view code
86- [`color-system-first`](references/color-system-first.md) - Prefer system colors before custom tokens
87- [`color-tint-not-brand-everywhere`](references/color-tint-not-brand-everywhere.md) - Set brand color as app tint, don't scatter it
88- [`color-audit-script`](references/color-audit-script.md) - Audit for ungoverned colors with a build script
89
90### 3. Component Style Library (CRITICAL)
91
92- [`style-dls-protocol-pattern`](references/style-dls-protocol-pattern.md) - Define custom style protocols for complex DLS components
93- [`style-equatable-views`](references/style-equatable-views.md) - Apply @Equatable to every design system view
94- [`style-accessibility-first`](references/style-accessibility-first.md) - Build accessibility into style protocols, not individual views
95- [`style-protocol-over-wrapper`](references/style-protocol-over-wrapper.md) - Use Style protocols instead of wrapper views
96- [`style-static-member-syntax`](references/style-static-member-syntax.md) - Provide static member syntax for custom styles
97- [`style-environment-awareness`](references/style-environment-awareness.md) - Make styles responsive to environment values
98- [`style-view-for-containers-modifier-for-styling`](references/style-view-for-containers-modifier-for-styling.md) - Views for containers, modifiers for styling
99- [`style-catalog-file`](references/style-catalog-file.md) - One style catalog file per component type
100- [`style-configuration-over-parameters`](references/style-configuration-over-parameters.md) - Prefer configuration structs over many parameters
101- [`style-preview-catalog`](references/style-preview-catalog.md) - Create a preview catalog for all styles
102
103### 4. Typography Scale (HIGH)
104
105- [`type-scale-enum`](references/type-scale-enum.md) - Define a type scale enum wrapping system styles
106- [`type-system-styles-first`](references/type-system-styles-first.md) - Use system text styles before custom ones
107- [`type-custom-font-registration`](references/type-custom-font-registration.md) - Register custom fonts with a centralized extension
108- [`type-max-styles-per-screen`](references/type-max-styles-per-screen.md) - Limit typography variations to 3-4 per screen
109- [`type-avoid-font-design-mixing`](references/type-avoid-font-design-mixing.md) - Use one font design per app
110
111### 5. Spacing & Sizing System (HIGH)
112
113- [`space-token-enum`](references/space-token-enum.md) - Define spacing tokens as a caseless enum
114- [`space-radius-tokens`](references/space-radius-tokens.md) - Define corner radius tokens by component type
115- [`space-no-magic-numbers`](references/space-no-magic-numbers.md) - Zero hardcoded numbers in view layout code
116- [`space-insets-pattern`](references/space-insets-pattern.md) - Use EdgeInsets constants for composite padding
117- [`space-size-tokens`](references/space-size-tokens.md) - Define size tokens for common dimensions
118
119### 6. Consistency & Governance (HIGH)
120
121- [`govern-naming-conventions`](references/govern-naming-conventions.md) - Enforce consistent naming conventions across all tokens
122- [`govern-spm-package-boundary`](references/govern-spm-package-boundary.md) - Isolate the design system as a local SPM package
123- [`govern-single-source-of-truth`](references/govern-single-source-of-truth.md) - Every visual value has one definition point
124- [`govern-lint-for-tokens`](references/govern-lint-for-tokens.md) - Use SwiftLint rules to enforce token usage
125- [`govern-design-system-directory`](references/govern-design-system-directory.md) - Isolate tokens in a dedicated directory
126- [`govern-migration-incremental`](references/govern-migration-incremental.md) - Migrate to tokens incrementally
127- [`govern-prevent-local-tokens`](references/govern-prevent-local-tokens.md) - Prevent feature modules from defining local tokens
128
129### 7. Asset Management (MEDIUM-HIGH)
130
131- [`asset-separate-catalogs`](references/asset-separate-catalogs.md) - Separate asset catalogs for colors, images, icons
132- [`asset-sf-symbols-first`](references/asset-sf-symbols-first.md) - Use SF Symbols before custom icons
133- [`asset-icon-export-format`](references/asset-icon-export-format.md) - Use PDF/SVG vectors, never multiple PNGs
134- [`asset-image-optimization`](references/asset-image-optimization.md) - Use compression and on-demand resources
135- [`asset-naming-convention`](references/asset-naming-convention.md) - Consistent naming convention for all assets
136
137### 8. Theme & Brand Infrastructure (MEDIUM)
138
139- [`theme-environment-key`](references/theme-environment-key.md) - Use EnvironmentKey for theme propagation
140- [`theme-dont-over-theme`](references/theme-dont-over-theme.md) - Avoid building a theme system unless needed
141- [`theme-tint-for-brand`](references/theme-tint-for-brand.md) - Use .tint() as primary brand expression
142- [`theme-light-dark-only`](references/theme-light-dark-only.md) - Use ColorScheme for light/dark, not custom theming
143- [`theme-brand-layer-separation`](references/theme-brand-layer-separation.md) - Separate brand identity from system mechanics
144
145## How to Use
146
147Read individual reference files for detailed explanations and code examples:
148
149- [Section definitions](references/_sections.md) - Category structure and impact levels
150- [Rule template](assets/templates/_template.md) - Template for adding new rules
151
152## Reference Files
153
154| File | Description |
155|------|-------------|
156| [references/_sections.md](references/_sections.md) | Category definitions and ordering |
157| [assets/templates/_template.md](assets/templates/_template.md) | Template for new rules |
158| [metadata.json](metadata.json) | Version and reference information |