NavFlow
It is a Swift Package that you can create any SwiftUI view as a navigation bar with your wishing height.
Install / Use
/learn @TolgaTaner/NavFlowREADME
NavFlow
NavFlow is a Swift Package that provides customizable navigation containers and navigation bars for SwiftUI applications. You can easily create your view a navigation bar and use it with either push or sheet navigation flows.
Overview
Navigation bar screenshots designed with NavFlow
<p align="center"> <img src="https://github.com/user-attachments/assets/5c1c6c03-abe9-419c-bd17-8c1de26507a0" alt="Screenshot 1" width="180" /> <img src="https://github.com/user-attachments/assets/315235be-ab5e-4b55-b7c7-f47502b30ea8" alt="Screenshot 4" width="180" /> <img src="https://github.com/user-attachments/assets/e3251ac2-4bf8-417f-aac8-83c4402fccc0" alt="Screenshot 2" width="180" /> <img width="180" src="https://github.com/user-attachments/assets/b9063730-1325-48ef-8bff-ee3fdfe3a68f" alt="Screenshot 5" /> </p>✨ Features
- 🚀 Custom Navigation Bar — Provide any SwiftUI view as a navigation bar.
- 📱 iOS Support — Includes UIKit-based navigation bar height calculation.
- 🔄 Push & Sheet Navigation — Works with both
NavigationLinkand.sheet. - 📏 Dynamic or Standard Height — Use
StandardNavigationHeightorDynamicNavigationHeight.
📦 Installation
Swift Package Manager (SPM)
In Xcode: Go to File → Add Packages… and enter the repo URL:
https://github.com/TolgaTaner/NavFlow.git
Or add it directly to your Package.swift:
dependencies: [
.package(url: "https://github.com/TolgaTaner/NavFlow.git", from: "1.2.4")
]
🔧 Usage
import NavFlow
import SwiftUI
struct ContentView: View {
@State private var navigationPath = NavigationPath()
var body: some View {
NavFlowNavigationBarView(
path: $navigationPath,
backgroundColor: .blue,
navigationBarHeight: StandardNavigationHeight()
) {
/// Custom View For Navigation Bar
HStack {
Text("Back").foregroundColor(.white)
Spacer()
Text("Home").bold().foregroundColor(.white)
Spacer()
Button("Edit") { /* action */ }.foregroundColor(.white)
}
} content: {
VStack {
Text("Main content here")
.padding()
}
}
}
}
Push Navigation
import SwiftUI
import NavFlow
struct PushExampleView: View {
var body: some View {
NavFlowNavigationPushLink(
color: .blue,
navigationHeight: StandardNavigationHeight(),
navigationBarView: {
HStack {
Text("Custom Nav")
.bold()
.foregroundColor(.white)
Spacer()
Button("Action") { /* do something */ }
.foregroundColor(.white)
}
},
destination: Text("Destination Page")
) {
Text("Go to Destination")
.padding()
.background(Color.gray.opacity(0.2))
.cornerRadius(8)
}
}
}
Sheet Navigation
NavFlowNavigationSheetLink(
color: .purple,
navigationBarView: {
Text("Sheet View").foregroundColor(.white)
},
destination: Text("This is a sheet")
) {
Text("Open Sheet")
.padding()
.background(Color.gray.opacity(0.2))
.cornerRadius(8)
}
📏 Navigation Bar Height
NavFlow manages bar height through the NavigationBarHeight protocol.
Standard Height (status bar + nav bar, notch-aware):
let height = StandardNavigationHeight()
Custom Dynamic Height:
let customHeight = DynamicNavigationHeight(value: 100)
Hiding Navigation Bar:
If you want, you can hide navigation bar, but you can still use its features.
NavFlowNavigationBarView(
backgroundColor: .black,
navigationBarHeight: StandardNavigationHeight(),
navigationBarView: { CustomBar() },
content: { OnboardingView() }
)
.hideNavFlowNavigationBar()
🛠 Requirements iOS 16+ Swift 5.9+
📄 License MIT License
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
