/toolbars
Modern SwiftUI toolbar patterns including customizable toolbars, search integration, transition effects, and platform-specific behavior. Use when implementing or customizing toolbars in SwiftUI.
$ npx -y skills add rshankras/claude-code-apple-skills --skill toolbars --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/toolbars
Context preview
The summary Claude sees to decide when to auto-load this skill.
Modern SwiftUI toolbar patterns including customizable toolbars, search integration, transition effects, and platform-specific behavior. Use when implementing or customizing toolbars in SwiftUI.
SKILL.md
toolbars.SKILL.mdname: toolbars
description: Modern SwiftUI toolbar patterns including customizable toolbars, search integration, transition effects, and platform-specific behavior. Use when implementing or customizing toolbars in SwiftUI.
allowed-tools: [Read, Glob, Grep]
last_verified: 2026-07-16
review_by: 2027-06-22
os_version: iOS 27 / macOS 27
SwiftUI Toolbars
Modern toolbar patterns for SwiftUI apps. Covers customizable toolbars, enhanced search integration, new placements, transition effects, and platform-specific considerations.
When This Skill Activates
Use this skill when the user:
- Wants to add or customize toolbars
- Asks about customizable/user-configurable toolbars
- Needs search field in toolbar with specific placement
- Wants toolbar item transitions or animations
- Asks about toolbar placements (bottomBar, largeSubtitle, etc.)
- Needs platform-specific toolbar behavior (iOS vs macOS)
- Wants to reposition system toolbar items (search, sidebar)
Decision Tree
What toolbar feature do you need?
|
+- User-customizable toolbar (add/remove/reorder items)
| +- Use .toolbar(id:) with ToolbarItem(id:)
|
+- Search field in toolbar
| +- Minimize to button -> .searchToolbarBehavior(.minimize)
| +- Reposition search -> DefaultToolbarItem(kind: .search, placement:)
|
+- Toolbar transition/animation
| +- Zoom transition from toolbar item -> .matchedTransitionSource(id:in:)
| +- Hide glass background -> .sharedBackgroundVisibility(.hidden)
|
+- Custom subtitle area content
| +- Use ToolbarItem(placement: .largeSubtitle)
|
+- System toolbar items with custom placement
| +- DefaultToolbarItem(kind: .search/.sidebar, placement:)
API Availability
| API | Minimum Version | Notes | |-----|----------------|-------| | `.toolbar { }` | iOS 14 | Basic toolbar | | `ToolbarItem(placement:)` | iOS 14 | Standard placements | | `.toolbar(id:)` | iOS 16 | Customizable toolbars | | `ToolbarItem(id:)` | iOS 16 | Items in customizable toolbars | | `ToolbarSpacer` | iOS 16 | Fixed and flexible spacers | | `.searchable()` | iOS 15 | Search integration | | `.searchToolbarBehavior(.minimize)` | iOS 17 | Minimized search button | | `DefaultToolbarItem(kind:placement:)` | iOS 18 | Reposition system items | | `ToolbarItem(placement: .largeSubtitle)` | iOS 18 | Subtitle area content | | `.matchedTransitionSource(id:in:)` | iOS 18 | Toolbar transition source | | `.sharedBackgroundVisibility()` | iOS 18 | Glass background control |
Customizable Toolbars
Allow users to personalize toolbar items by adding, removing, and rearranging:
ContentView()
.toolbar(id: "main-toolbar") {
ToolbarItem(id: "tag") {
TagButton()
}
ToolbarItem(id: "share") {
ShareButton()
}
ToolbarSpacer(.fixed)
ToolbarItem(id: "more") {
MoreButton()
}
}Toolbar Spacers
ToolbarSpacer(.fixed) // Fixed-width space
ToolbarSpacer(.flexible) // Flexible space — pushes items apart
Anti-Patterns
// ❌ Missing IDs in customizable toolbar — items can't be customized
.toolbar(id: "main") {
ToolbarItem { // No id parameter
ShareButton()
}
}
// ✅ Every item needs its own ID
.toolbar(id: "main") {
ToolbarItem(id: "share") {
ShareButton()
}
}Enhanced Search Integration
Minimized Search
Renders search field as a compact button that expands on tap:
@State private var searchText = ""
NavigationStack {
RecipeList()
.searchable(text: $searchText)
.searchToolbarBehavior(.minimize)
}Repositioning Search
Move the default search field to a different toolbar position:
NavigationSplitView {
AllCalendarsView()
} detail: {
SelectedCalendarView()
.searchable(text: $query)
.toolbar {
ToolbarItem(placement: .bottomBar) {
CalendarPicker()
}
ToolbarItem(placement: .bottomBar) {
Invites()
}
DefaultToolbarItem(kind: .search, placement: .bottomBar)
ToolbarSpacer(placement: .bottomBar)
ToolbarItem(placement: .bottomBar) {
NewEventButton()
}
}
}System-Defined Toolbar Items
Reposition system items with custom placements:
.toolbar {
DefaultToolbarItem(kind: .search, placement: .bottomBar)
DefaultToolbarItem(kind: .sidebar, placement: .navigationBarLeading)
}Large Subtitle Placement
Place custom content in the navigation bar subtitle area:
NavigationStack {
DetailView()
.navigationTitle("Title")
.navigationSubtitle("Subtitle")
.toolbar {
ToolbarItem(placement: .largeSubtitle) {
CustomLargeNavigationSubtitle()
}
}
}Transition Effects
Matched Transition from Toolbar
Create zoom transitions originating from a toolbar button:
struct ContentView: View {
@State private var isPresented = false
@Namespace private var namespace
var body: some View {
NavigationStack {
DetailView()
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("Show Sheet", systemImage: "globe") {
isPresented = true
}
}
.matchedTransitionSource(id: "world", in: namespace)
}
.sheet(isPresented: $isPresented) {
SheetView()
.navigationTransition(
.zoom(sourceID: "world", in: namespace))
}
}
}
}Glass Background Control
Control the shared glass background on toolbar items:
ContentView()
.toolbar(id: "main") {
ToolbarItem(id: "build-status", placement: .principal) {Read more
name: toolbars description: Modern SwiftUI toolbar patterns including customizable toolbars, search integration, transition effects, and platform-specific behavior. Use when implementing or customizing toolbars in SwiftUI. allowed-tools: [Read, Glob, Grep] last_verified: 2026-07-16 review_by: 2027-06-22 os_version: iOS 27 / macOS 27
SwiftUI Toolbars
Modern toolbar patterns for SwiftUI apps. Covers customizable toolbars, enhanced search integration, new placements, transition effects, and platform-specific considerations.
When This Skill Activates
Use this skill when the user:
- Wants to add or customize toolbars
- Asks about customizable/user-configurable toolbars
- Needs search field in toolbar with specific placement
- Wants toolbar item transitions or animations
- Asks about toolbar placements (bottomBar, largeSubtitle, etc.)
- Needs platform-specific toolbar behavior (iOS vs macOS)
- Wants to reposition system toolbar items (search, sidebar)
Decision Tree
What toolbar feature do you need? | +- User-customizable toolbar (add/remove/reorder items) | +- Use .toolbar(id:) with ToolbarItem(id:) | +- Search field in toolbar | +- Minimize to button -> .searchToolbarBehavior(.minimize) | +- Reposition search -> DefaultToolbarItem(kind: .search, placement:) | +- Toolbar transition/animation | +- Zoom transition from toolbar item -> .matchedTransitionSource(id:in:) | +- Hide glass background -> .sharedBackgroundVisibility(.hidden) | +- Custom subtitle area content | +- Use ToolbarItem(placement: .largeSubtitle) | +- System toolbar items with custom placement | +- DefaultToolbarItem(kind: .search/.sidebar, placement:)
API Availability
| API | Minimum Version | Notes | |-----|----------------|-------| | `.toolbar { }` | iOS 14 | Basic toolbar | | `ToolbarItem(placement:)` | iOS 14 | Standard placements | | `.toolbar(id:)` | iOS 16 | Customizable toolbars | | `ToolbarItem(id:)` | iOS 16 | Items in customizable toolbars | | `ToolbarSpacer` | iOS 16 | Fixed and flexible spacers | | `.searchable()` | iOS 15 | Search integration | | `.searchToolbarBehavior(.minimize)` | iOS 17 | Minimized search button | | `DefaultToolbarItem(kind:placement:)` | iOS 18 | Reposition system items | | `ToolbarItem(placement: .largeSubtitle)` | iOS 18 | Subtitle area content | | `.matchedTransitionSource(id:in:)` | iOS 18 | Toolbar transition source | | `.sharedBackgroundVisibility()` | iOS 18 | Glass background control |
Customizable Toolbars
Allow users to personalize toolbar items by adding, removing, and rearranging:
ContentView()
.toolbar(id: "main-toolbar") {
ToolbarItem(id: "tag") {
TagButton()
}
ToolbarItem(id: "share") {
ShareButton()
}
ToolbarSpacer(.fixed)
ToolbarItem(id: "more") {
MoreButton()
}
}Toolbar Spacers
ToolbarSpacer(.fixed) // Fixed-width space ToolbarSpacer(.flexible) // Flexible space — pushes items apart
Anti-Patterns
// ❌ Missing IDs in customizable toolbar — items can't be customized
.toolbar(id: "main") {
ToolbarItem { // No id parameter
ShareButton()
}
}
// ✅ Every item needs its own ID
.toolbar(id: "main") {
ToolbarItem(id: "share") {
ShareButton()
}
}Enhanced Search Integration
Minimized Search
Renders search field as a compact button that expands on tap:
@State private var searchText = ""
NavigationStack {
RecipeList()
.searchable(text: $searchText)
.searchToolbarBehavior(.minimize)
}Repositioning Search
Move the default search field to a different toolbar position:
NavigationSplitView {
AllCalendarsView()
} detail: {
SelectedCalendarView()
.searchable(text: $query)
.toolbar {
ToolbarItem(placement: .bottomBar) {
CalendarPicker()
}
ToolbarItem(placement: .bottomBar) {
Invites()
}
DefaultToolbarItem(kind: .search, placement: .bottomBar)
ToolbarSpacer(placement: .bottomBar)
ToolbarItem(placement: .bottomBar) {
NewEventButton()
}
}
}System-Defined Toolbar Items
Reposition system items with custom placements:
.toolbar {
DefaultToolbarItem(kind: .search, placement: .bottomBar)
DefaultToolbarItem(kind: .sidebar, placement: .navigationBarLeading)
}Large Subtitle Placement
Place custom content in the navigation bar subtitle area:
NavigationStack {
DetailView()
.navigationTitle("Title")
.navigationSubtitle("Subtitle")
.toolbar {
ToolbarItem(placement: .largeSubtitle) {
CustomLargeNavigationSubtitle()
}
}
}Transition Effects
Matched Transition from Toolbar
Create zoom transitions originating from a toolbar button:
struct ContentView: View {
@State private var isPresented = false
@Namespace private var namespace
var body: some View {
NavigationStack {
DetailView()
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("Show Sheet", systemImage: "globe") {
isPresented = true
}
}
.matchedTransitionSource(id: "world", in: namespace)
}
.sheet(isPresented: $isPresented) {
SheetView()
.navigationTransition(
.zoom(sourceID: "world", in: namespace))
}
}
}
}Glass Background Control
Control the shared glass background on toolbar items:
ContentView()
.toolbar(id: "main") {
ToolbarItem(id: "build-status", placement: .principal) {A collection of Claude Code skills for iOS, macOS, watchOS, visionOS, and Apple platform development. These skills help you plan and build apps, maintain code quality, ensure HIG compliance, and guide you from idea to App Store.
Repo: rshankras/claude-code-apple-skills
Other skills on rshankras-apple-skills.
- /app-store
App Store optimization and marketing skills for descriptions, screenshots, keywords, review responses, and comprehensive promotional strategy. Use when user needs help with App Store presence, ASO, marketing, or customer communication.
Open skill - /ad-attribution
Privacy-preserving ad measurement with AdAttributionKit (SKAdNetwork's successor) — install and re-engagement attribution, conversion-value strategy under crowd anonymity, and end-to-end postback testing. Use when running paid acquisition beyond Apple Ads, measuring
Open skill - /app-description-writer
Generate compelling App Store descriptions that convert browsers into users. Use when writing initial descriptions, improving existing copy, or drafting promotional text and What's New for a major update.
Open skill - /apple-search-ads
Apple Search Ads campaign strategy for indie developers — paid acquisition, keyword bidding, budget planning, and ROAS optimization. Use when user asks about running ads, paid user acquisition, or Apple Search Ads campaigns.
Open skill - /iap-finalizer
Take a one-time in-app purchase from MISSING_METADATA to READY_TO_SUBMIT in App Store Connect — set its price schedule and localized display name/description (and optional review screenshot) via the ASC REST API. Use at Phase 6 (Pre-Release), after the IAP is built in-app (Phase
Open skill - /keyword-optimizer
Optimize app title, subtitle, and keywords for maximum App Store discoverability. Use when launching a new app, improving search rankings, entering new markets/languages, or safely optimizing ASO for an app with existing traffic.
Open skill

