Files
TUIkit/Sources/TUIkitExample/Components/DemoSection.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

40 lines
848 B
Swift

// 🖥️ TUIKit — Terminal UI Kit for Swift
// DemoSection.swift
//
// Created by LAYERED.work
// CC BY-NC-SA 4.0
import TUIkit
/// A section with a styled title and content.
///
/// Used to group related demo content with a yellow underlined title.
///
/// # Example
///
/// ```swift
/// DemoSection("Basic Features") {
/// Text("Feature 1")
/// Text("Feature 2")
/// }
/// ```
struct DemoSection<Content: View>: View {
let title: String
let content: Content
init(_ title: String, @ViewBuilder content: () -> Content) {
self.title = title
self.content = content()
}
var body: some View {
VStack(alignment: .leading) {
Text(title)
.bold()
.underline()
.foregroundColor(.palette.accent)
content
}
}
}