Files
TUIkit/Sources/TUIKitExample/Components/DemoSection.swift
T
phranck f1a9088779 Refactor: Clean up half-padding and improve demos
- Remove abandoned half-padding feature from BorderModifier
- Simplify block appearance rendering in BorderModifier, ContainerView, Menu
- Update theme colors for all 4 phosphor themes (container backgrounds)
- Fix VStack alignment (leading/center/trailing now work correctly)
- Improve ContainersPage demos (alignment, padding display)
- Replace hardcoded colors with theme colors in DemoSection
- Update documentation (memory.md, whats-next.md, to-dos.md)
2026-01-29 01:21:39 +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
}
}
}