swiftui-toolbar

Installation
SKILL.md

SwiftUI Toolbar

SwiftUI's toolbar system: you declare what goes in the bar with ToolbarContent; the system decides where and how it renders per platform — and on iOS 26 groups items into shared Liquid Glass capsules. The deep API reference (every placement, ToolbarSpacer + shared-glass grouping, visibility/background/colorScheme, role, title menu/display mode, patterns, availability) lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics.

Dials

Set these explicitly at the start; they change what "correct" means.

  1. PLACEMENT — the scope of placements in play: semantic (default; role-based — .principal, .primaryAction, .confirmationAction/.cancellationAction, .navigation — system positions and styles them) · positional (.topBarLeading/.topBarTrailing/.bottomBar, only when a specific edge is genuinely required). Prefer semantic; drop to positional only when no role fits.
  2. GLASS — iOS 26 shared-capsule behavior: shared (default; adjacent items merge into one glass capsule, split groups with ToolbarSpacer) · hidden (sharedBackgroundVisibility(.hidden), availability-gated — item stands alone with no capsule). The material itself is liquid-glass's domain.
  3. ROLE — toolbarRole(_:): default (.automatic/.navigationStack) · editor (content-editing layout, spreads items on iPad) · browser (document/file browsing). Match the screen's job.

When to use

Building or reviewing any toolbar / navigation-bar / bottom-bar content: action buttons, custom titles, modal confirm/cancel bars, grouped glass clusters, or bar visibility/background work. Explicitly out of scope: for the glass material (.glassEffect, GlassEffectContainer, glass buttons) use liquid-glass; for the tab bar use swiftui-tabview (here you only toggle it via for: .tabBar).

Core rules

Installs
1
GitHub Stars
1
First Seen
Jun 18, 2026
swiftui-toolbar — moritztucher/swift-agent-skills