Awesome-omni-skill swiftui-components
SwiftUI component expert for building reusable views, custom modifiers, view compositions, and Liquid Glass integration. Use when creating new SwiftUI views, refactoring UI code, applying design tokens, or building production-ready component libraries for macOS Tahoe (26) and iOS 26.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/design/swiftui-components" ~/.claude/skills/diegosouzapw-awesome-omni-skill-swiftui-components && rm -rf "$T"
skills/design/swiftui-components/SKILL.mdSwiftUI Components
Lifecycle Position
Phase 3 (Implement). After design from
macos-app-design. Use templates and patterns during implementation. Next: swiftui-view-refactor for Phase 5 review.
Quick Start
For standard patterns, see PATTERNS.md. For API reference, see REFERENCE.md.
Instructions
When creating or refactoring SwiftUI components:
-
Analyze the required component functionality
- What data does the component display?
- What interactions does it support?
- Does it need Liquid Glass effects?
-
Check existing components for reuse
- Grep the project for similar views before creating new ones
- Check if a custom
already covers the styling needViewModifier - Look for shared
definitionsPreferenceKey
-
Apply templates from
directorytemplates/
— Standard view with @Observable ViewModel, .task lifecycle, accessibilityview-template.swift
— @Observable @MainActor ViewModel with repository DI patternviewmodel-template.swift
— Custom ViewModifier with View extension and conditional applicationmodifier-template.swift
— Liquid Glass component with GlassEffectContainer, glassEffectID, morph transitions, backgroundExtensionEffect, and toolbar groupingglass-component-template.swift
— Complete paged onboarding flow with persistence and view modifiertemplates/onboarding/
— Cross-platform settings screen (iOS + macOS) withtemplates/settings/
model@Observable
-
Follow project styling conventions
- Use semantic colors (
,.primary
,.secondary
) over hardcoded colors.tertiary - Prefer
system text styles over fixed font sizes.font(.body) - Use
andRoundedRectangle(cornerRadius:)
for shapesConcentricRectangle - Apply
to all icon-only buttons.accessibilityLabel - Use
instead of.task {}
for async work.onAppear { Task { } }
- Use semantic colors (
Component Checklist
Before submitting a new component, verify:
- View is under 100 lines (extract subviews if larger)
-
used for view models (not@Observable
)ObservableObject -
on view model class@MainActor - Repository/service dependencies injected via init (not hardcoded)
-
used for async loading (auto-cancels on disappear).task {} -
on icon-only buttons and decorative imagesaccessibilityLabel - Dynamic Type supported (no hardcoded font sizes)
- Dark mode tested (use semantic colors)
- Reduce Transparency and Reduce Motion tested for glass effects
-
in stored closures and Timer callbacks[weak self] -
conformance verified for types crossing isolation boundariesSendable - Preview provided with
macro#Preview { }
Liquid Glass Guidelines
When applying Liquid Glass to custom components:
- Use sparingly — only on the most important functional elements
- Always wrap in
— required for performance and morph animationsGlassEffectContainer - Assign
when glass views should morph during transitionsglassEffectID - Apply
to hero images in split views.backgroundExtensionEffect() - Group toolbar items with
for separate glass backgroundsToolbarSpacer(.fixed) - Remove custom backgrounds on toolbars, tab bars, and navigation bars — they block glass
- Use
instead of custom glass effects on buttons.buttonStyle(.glass) - Test with accessibility — Reduce Transparency removes glass; ensure fallback looks good
Templates
Base Templates (templates/
)
templates/
— Standard view with @Observable ViewModel, .task lifecycle, accessibilityview-template.swift
— @Observable @MainActor ViewModel with repository DI patternviewmodel-template.swift
— Custom ViewModifier with View extension and conditional applicationmodifier-template.swift
— Liquid Glass component with GlassEffectContainer, glassEffectID, morph transitions, backgroundExtensionEffect, and toolbar groupingglass-component-template.swift
Onboarding Flow (templates/onboarding/
)
templates/onboarding/Complete paged onboarding with persistence and view modifier:
— TabView-based paged flow with page indicatorsOnboardingView.swift
— Data model for onboarding page contentOnboardingPage.swift
— Individual page layout (icon, title, description)OnboardingPageView.swift
—OnboardingStorage.swift
-backed completion tracking@AppStorage
—OnboardingModifier.swift
view modifier for one-time display.onboarding()
Settings Screen (templates/settings/
)
templates/settings/Cross-platform settings with iOS + macOS support:
— Root settings view with platform-adaptive layoutSettingsView.swift
—AppSettings.swift
settings model with persistence@Observable
— Reusable row component for settings sectionsSettingsRow.swift
— App info, version, creditsAboutSettingsView.swift
— Account management sectionAccountSettingsView.swift
File Structure
skills/swiftui-components/ ├── SKILL.md ← You are here (entry point) ├── references/ ← Deep documentation by category (scraped from Apple docs) │ ├── PATTERNS.md ← ViewModifier, ViewBuilder, PreferenceKey, Layout, composition patterns │ ├── REFERENCE.md ← API quick-reference tables for SwiftUI protocols, wrappers, and modifiers │ ├── views_builtin.md │ ├── modifiers_styling.md │ ├── modifiers_interaction.md │ ├── layout_system.md │ ├── shapes_and_drawing.md │ ├── animation_and_transitions.md │ ├── data_flow.md │ ├── presentations.md │ └── index.md └── templates/ ← Copy-paste-ready Swift templates ├── view-template.swift ├── viewmodel-template.swift ├── modifier-template.swift ├── glass-component-template.swift ├── onboarding/ ← Complete onboarding flow (5 files) │ ├── OnboardingView.swift │ ├── OnboardingPage.swift │ ├── OnboardingPageView.swift │ ├── OnboardingStorage.swift │ └── OnboardingModifier.swift └── settings/ ← Cross-platform settings screen (5 files) ├── SettingsView.swift ├── AppSettings.swift ├── SettingsRow.swift ├── AboutSettingsView.swift └── AccountSettingsView.swift
Companion Skills & Agents
- macos-architect — Consult for architectural decisions (navigation patterns, multi-window, state management hierarchy)
- swift-reviewer — Run code reviews against Swift 6 concurrency, memory, Liquid Glass, and accessibility standards
- apple-liquid-glass-design — Deep reference for all Liquid Glass APIs and the Landmarks sample app
Data Source
This skill was generated from 170+ Apple documentation pages via:
skill-seekers scrape --config configs/swiftui-components.json
To refresh with updated documentation, re-run the scrape.