Files
TUIkit/Sources/TUIkitExample/Components/HeaderView.swift
T
phranck 95029184e7 Chore: Rename TUIKit to TUIkit
- Rename module, targets and products in Package.swift
- Rename directories: Sources/TUIkit, TUIkitExample, Tests/TUIkitTests
- Rename files: TUIkit.swift, TUIkit.docc/TUIkit.md
- Update all import statements, module-qualified calls, file headers
- Update doc comments, string literals and DocC articles
- Update CI workflow, README, .swiftlint.yml and markdown docs
- Merge platform badges into single combined badge in README
- Add "Example App auslagern" task to to-dos.md
2026-01-30 20:29:29 +01:00

51 lines
1.2 KiB
Swift

//
// HeaderView.swift
// TUIkitExample
//
// A reusable header component for demo pages.
//
import TUIkit
/// A styled header with title on the left and version on the right.
///
/// Used at the top of each demo page to provide consistent branding
/// and optional subtitle.
///
/// # Example
///
/// ```swift
/// HeaderView(
/// title: "My Demo",
/// subtitle: "An optional description"
/// )
/// ```
struct HeaderView: View {
let title: String
let subtitle: String?
init(title: String, subtitle: String? = nil) {
self.title = title
self.subtitle = subtitle
}
var body: some View {
VStack {
HStack {
Text(title)
.bold()
.foregroundColor(.theme.accent)
Spacer()
Text("TUIkit v\(tuiKitVersion)")
.foregroundColor(.theme.foregroundTertiary)
}
if let subtitleText = subtitle {
Text(subtitleText)
.foregroundColor(.theme.foregroundSecondary)
.italic()
}
Divider(character: "═")
}
}
}