swiftui-toolbar
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.
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.GLASS— iOS 26 shared-capsule behavior:shared(default; adjacent items merge into one glass capsule, split groups withToolbarSpacer) ·hidden(sharedBackgroundVisibility(.hidden), availability-gated — item stands alone with no capsule). The material itself isliquid-glass's domain.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).