Expert guidance on SwiftUI style-driven components following Apple patterns (ButtonStyle, LabelStyle). Use when: building components with style protocols, implementing configuration patterns, adding environment-based styling, creating extensible component libraries, reviewing component architecture, or writing snapshot and unit tests for components.
This skill provides expert guidance on building, reviewing, and extending SwiftUI components following the style-driven architecture pattern. This pattern emphasizes extensibility, maintainability, and Apple-style API design, making it ideal for building reusable component libraries.
ButtonStyle, LabelStyle) as the gold standard.LabelStyleConfiguration.Title).public.style.makeBody in AnyView for type erasure.DynamicProperty for style protocols, not Sendable.any [Component]Style).[Component]Style — defines HOW to render[Component]StyleConfiguration — contains WHAT to renderUse style protocol when:
@Environment)Skip style protocol when:
references/component-structure.mdreferences/style-protocol.mdreferences/environment-keys.mdreferences/common-patterns.md[Component]StylemakeBody(configuration:).myStyle)DynamicProperty, @ViewBuilder @MainActorinternalstyle.makeBody in AnyViewany [Component]Style)references/component-structure.mdreferences/style-protocol.mdreferences/style-protocol.mdreferences/environment-keys.mdreferences/common-patterns.mdreferences/common-patterns.mdreferences/documentation.mdreferences/design-system.mdreferences/testing.mdreferences/previews.mdreferences/accessibility.mdreferences/advanced-patterns.md[Component]/
├── EnvironmentKeys/[Component]StyleKey.swift
├── Styles/
│ ├── [Component]Style.swift
│ ├── [Component]StyleConfiguration.swift
│ └── Default[Component]Style.swift
└── [Component].swift
DynamicProperty, @ViewBuilder @MainActor func makeBodystruct Content: View with private let _body: () -> AnyViewinternal (not public), @MainActorAnyView(style.makeBody(configuration: .init(...)))@Entry public var style: any [Component]Style = .automaticfunc style(_ style: some [Component]Style) -> some ViewDynamicProperty for style protocolsinternalstyle.makeBody in AnyView.compact, .outlined)Sendable to style protocolspublicAnyView directly as configuration property typeforegroundColor() (deprecated — use foregroundStyle()).cornerRadius() (deprecated — use clipShape())DynamicPropertymakeBody has @ViewBuilder @MainActorinternalstyle.makeBody in AnyView@Entry macroany [Component]Style)some [Component]Style).automatic)/// doc commentsreferences/previews.md)references/testing.md)references/accessibility.md)references/design-system.md)references/component-structure.md — File organization, MARK conventionsreferences/documentation.md — Doc comments following Apple conventionsreferences/style-protocol.md — Protocol, configuration, anti-patternsreferences/environment-keys.md — Environment injection, usage patternsreferences/common-patterns.md — Convenience inits, parameterized styles, bindings, rolesreferences/advanced-patterns.md — State machines, dual protocols, result buildersreferences/testing.md — Snapshots, config tests, test helpersreferences/previews.md — Preview structure, stateful helpers, snapshot mappingreferences/design-system.md — Design tokens, typography, colorsreferences/accessibility.md — Labels, identifiers, Dynamic TypeStyle-driven components prioritize:
ButtonStyle, LabelStyle conventionsSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer