swiftship/internal/skills/data/always-macos/components/SKILL.md
macOS UI components: button styles, context menus, tables, drag-and-drop, keyboard shortcuts. Use when working on macOS component patterns, desktop UI, or Mac app interactions. Triggers: Button, Table, Menu, contextMenu, keyboardShortcut, component.
npx skillsauth add abdullah4ai/apple-developer-toolkit componentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
macOS apps should feel like professional desktop tools, not enlarged phone apps.
Sidebar: Use translucent sidebar by default (NavigationSplitView handles this). The sidebar background is slightly transparent when the window is active, becoming opaque when inactive — this signals which window has focus.
Color density: Similar to iOS — accent colors, branded surfaces, and colored icons are appropriate. However, in macOS Tahoe (26), sidebar icons default to monochrome (not tinted) since tinted icons clash with the translucent sidebar.
Content areas: Use opaque AppTheme backgrounds for content areas. Sidebars are the main translucent element.
// Primary action
Button("Save") { save() }
.buttonStyle(.borderedProminent)
.keyboardShortcut("s", modifiers: .command)
// Secondary action
Button("Cancel") { cancel() }
.buttonStyle(.bordered)
.keyboardShortcut(.escape)
// Tertiary / inline
Button("Details") { showDetails() }
.buttonStyle(.borderless)
// Link-style
Button("Learn More") { openURL() }
.buttonStyle(.link)
BUTTON HIERARCHY:
| Level | Style | Use Case |
|-------|-------|----------|
| Primary action | .borderedProminent | Save, Confirm, Send |
| Secondary | .bordered | Cancel, Settings |
| Tertiary | .borderless | Inline actions |
| Link | .link | Navigation, external links |
// Translucent glass background
VStack { content }
.glassEffect()
// Glass button styles
Button("Action") { }
.buttonStyle(.glass)
Button("Primary") { }
.buttonStyle(.glassProminent)
Text(item.name)
.contextMenu {
Button("Copy", systemImage: "doc.on.doc") { copy(item) }
.keyboardShortcut("c", modifiers: .command)
Button("Delete", systemImage: "trash", role: .destructive) { delete(item) }
Divider()
Menu("Move to") {
ForEach(folders) { folder in
Button(folder.name) { move(item, to: folder) }
}
}
}
Every primary action and menu item MUST have a keyboard shortcut:
Button("New Item") { createItem() }
.keyboardShortcut("n", modifiers: .command)
Button("Delete") { deleteItem() }
.keyboardShortcut(.delete, modifiers: .command)
Button("Find") { showSearch() }
.keyboardShortcut("f", modifiers: .command)
// Draggable source
Text(item.name)
.draggable(item)
// Drop destination
List { ... }
.dropDestination(for: Item.self) { items, location in
handleDrop(items, at: location)
return true
}
Table(items) {
TableColumn("Name", value: \.name)
TableColumn("Date") { item in
Text(item.date, style: .date)
}
TableColumn("Size") { item in
Text(item.formattedSize)
}
}
.tableStyle(.inset(alternatesRowBackgrounds: true))
Menu("Options", systemImage: "ellipsis.circle") {
Button("Import...", systemImage: "square.and.arrow.down") { importData() }
Button("Export...", systemImage: "square.and.arrow.up") { exportData() }
Divider()
Toggle("Show Hidden", isOn: $showHidden)
}
Toggle("Enable Notifications", isOn: $notificationsEnabled)
.toggleStyle(.switch)
Form {
Section("General") {
TextField("Name", text: $name)
Picker("Theme", selection: $theme) {
Text("System").tag(Theme.system)
Text("Light").tag(Theme.light)
Text("Dark").tag(Theme.dark)
}
}
Section("Advanced") {
Toggle("Debug Mode", isOn: $debugMode)
.toggleStyle(.switch)
}
}
.formStyle(.grouped)
ContentUnavailableView(
"No Documents",
systemImage: "doc",
description: Text("Create a new document to get started")
)
.keyboardShortcut().contextMenu {} for right-click interactions on data itemsTable for tabular data display (macOS-specific view)Menu for dropdown actions in toolbars.formStyle(.grouped) for preference forms.draggable() / .dropDestination() for drag-and-drop.borderedProminent per visible area.foregroundStyle() not .foregroundColor().clipShape(.rect(cornerRadius:)) not .cornerRadius()testing
Use for 3D games: racing, 3D sports, board games, marble maze, tower defense, bowling. SceneKit + SceneView architecture, 3D scene hierarchy, physics, game loop, primitives, materials, cameras, particles, audio.
documentation
Game UI patterns: SwiftUI HUD overlays on SpriteKit, menus (main/pause/game-over), virtual joystick/d-pad, score displays, health bars, tutorial onboarding.
tools
Download free game sprites/textures/3D models and generate procedural assets. Covers nw_download_asset tool, texture factories, sprite atlas organization, 3D model loading, and programmatic asset creation.
testing
Use for 2D games: arcade, puzzle, sports, ping pong, platformer, shooter, 2D racing. SpriteKit + SpriteView architecture, scene hierarchy, physics, game loop, audio, particles, game feel.