Skip to content

Instantly share code, notes, and snippets.

@larsaugustin
Created September 16, 2025 09:44
Show Gist options
  • Save larsaugustin/83837ab1ac7105a6c43c1346fad45e69 to your computer and use it in GitHub Desktop.
Save larsaugustin/83837ab1ac7105a6c43c1346fad45e69 to your computer and use it in GitHub Desktop.
FauxToolbar SwiftUI
@main
struct FauxToolbarApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.toolbarTitleDisplayMode(.inline)
.toolbarBackgroundVisibility(.hidden, for: .windowToolbar)
}
.windowToolbarLabelStyle(fixed: .iconOnly)
.windowToolbarStyle(.unified)
}
}
struct ContentView: View {
var body: some View {
VStack {
TextField("", text: .constant("Right Click Me"))
.frame(width: 300)
.padding(.top)
Spacer()
}
.ignoresSafeArea()
.toolbarBackgroundVisibility(.hidden, for: .windowToolbar)
.toolbar {
Spacer()
}.navigationTitle(Text(""))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment