mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
- 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
51 lines
1.2 KiB
Swift
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: "═")
|
|
}
|
|
}
|
|
}
|