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

41 lines
835 B
Swift

//
// DemoSection.swift
// TUIkitExample
//
// A reusable section component for organizing demo content.
//
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(.theme.accent)
content
}
}
}