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
41 lines
835 B
Swift
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
|
|
}
|
|
}
|
|
}
|