swiftui-macos-controls

Provide macOS-specific SwiftUI control styles and AppKit wrapping patterns.

1|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/LaughingJackalope/macos-skills --skill swiftui-macos-controls
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-macos-controls
Source: https://github.com/LaughingJackalope/macos-skills/tree/main/swiftui-macos-controls
Command: npx skills add https://github.com/LaughingJackalope/macos-skills --skill swiftui-macos-controls

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SwiftUI controls render and behave differently on macOS compared to iOS, leading to non-native UI, broken accessibility, and unexpected rendering when using cross-platform defaults or overlooking macOS-only controls like FontPicker and NSPathControl. Developers often waste time troubleshooting platform-specific quirks such as segmented picker truncation, NSViewRepresentable zero-height collapse, and missing AppKit interop patterns.

Core Features & Use Cases

  • Comprehensive control style reference: Covers all macOS-specific SwiftUI control styles including Button (bordered, borderedProminent, plain, link, accessoryBar), Picker (segmented, menu, radioGroup, inline), Toggle (switch, checkbox), Slider, Stepper, ColorPicker, FontPicker, ControlGroup, and control sizing.
  • AppKit interop recipes: Provides working NSViewRepresentable wrappers for AppKit-only controls like NSPathControl and NSLevelIndicator, plus guidance on avoiding common Auto Layout and sizing pitfalls.
  • Real-world use case: For example, when building a macOS document-based app's preferences panel, use this skill to implement a native radio group picker for theme selection, an accessory bar button style for metadata actions, and a FontPicker for user font customization that matches macOS design guidelines.

Quick Start

Use the swiftui-macos-controls skill to add a native macOS toolbar with a text formatting ControlGroup and a segmented picker for view mode selection to your SwiftUI app.

Frequently Asked Questions about swiftui-macos-controls

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my SwiftUI NSViewRepresentable collapse to zero height on macOS?

NSViewRepresentable collapses to zero height on macOS due to Auto Layout and sizing pitfalls. You can resolve this by applying correct AppKit wrapping patterns that provide explicit sizing constraints for the embedded AppKit control.

How do I implement a native radio group picker in SwiftUI for macOS?

To implement a native radio group picker in SwiftUI for macOS, apply the platform-specific radioGroup picker style. This ensures your control matches macOS design guidelines for preference panels instead of falling back to cross-platform rendering.

What is the correct SwiftUI button style for macOS accessory bar actions?

The correct SwiftUI button style for macOS accessory bar actions is the accessoryBar style. Using this platform-specific style ensures your toolbar or metadata actions render natively and maintain accessibility correctness on macOS.

Can I use AppKit-only controls like NSPathControl and NSLevelIndicator in SwiftUI?

You can use AppKit-only controls like NSPathControl and NSLevelIndicator in SwiftUI by implementing NSViewRepresentable wrappers. This interop pattern bridges AppKit controls into your SwiftUI macOS app while avoiding common layout rendering issues.

How do I add a FontPicker to a macOS document-based app in SwiftUI?

To add a FontPicker to a macOS document-based app in SwiftUI, use the native macOS FontPicker control for user font customization. This ensures your font selection interface matches macOS design guidelines and accessibility requirements.