Files
TUIkit/Sources/TUIkitExample/Components/HeaderView.swift
T
phranck f77cd8bdec Chore: Unified file headers across all Swift files
Update IDETemplateMacros.plist and replace headers in 136 Swift files with
new format: 🖥️ TUIKit — Terminal UI Kit for Swift. Remove sdsd.swift template draft.
2026-02-03 20:48:29 +01:00

50 lines
1.2 KiB
Swift
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 🖥 TUIKit Terminal UI Kit for Swift
// HeaderView.swift
//
// Created by LAYERED.work
// CC BY-NC-SA 4.0
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(.palette.accent)
Spacer()
Text("TUIkit v\(tuiKitVersion)")
.foregroundColor(.palette.foregroundTertiary)
}
if let subtitleText = subtitle {
Text(subtitleText)
.foregroundColor(.palette.foregroundSecondary)
.italic()
}
Divider(character: "")
}
}
}