Files
TUIkit/Sources/TUIKitExample/Pages/ContainersPage.swift
T
phranck 45e73faafb refactor: Rename package from SwiftTUI to TUIKit
BREAKING CHANGE: Package name changed due to name collision with
existing rensbreur/SwiftTUI package.

Changes:
- Rename package from SwiftTUI to TUIKit in Package.swift
- Rename Sources/SwiftTUI to Sources/TUIKit
- Rename Sources/SwiftTUIExample to Sources/TUIKitExample
- Rename Tests/SwiftTUITests to Tests/TUIKitTests
- Rename SwiftTUI.swift to TUIKit.swift
- Update all imports: import SwiftTUI -> import TUIKit
- Update all code references: SwiftTUI.renderToBuffer -> TUIKit.renderToBuffer
- Update documentation comments
- Rename swiftTUIVersion to tuiKitVersion

All 181 tests passing.
2026-01-28 19:32:09 +01:00

63 lines
1.8 KiB
Swift

//
// ContainersPage.swift
// TUIKitExample
//
// Demonstrates container view capabilities.
//
import TUIKit
/// Container views demo page.
///
/// Shows various container views including:
/// - Card (bordered container with padding)
/// - Box (simple bordered container)
/// - Panel (container with title in border)
/// - All available border styles
struct ContainersPage: View {
var body: some View {
VStack(spacing: 1) {
HeaderView(title: "Container Views Demo")
HStack(spacing: 2) {
// Card example
VStack(alignment: .leading) {
Text("Card").bold().foregroundColor(.yellow)
Card(borderStyle: .rounded, borderColor: .cyan) {
Text("A Card view")
Text("with padding").dim()
}
}
// Box example
VStack(alignment: .leading) {
Text("Box").bold().foregroundColor(.yellow)
Box(.doubleLine, color: .green) {
Text("Simple Box")
}
}
// Panel example
VStack(alignment: .leading) {
Text("Panel").bold().foregroundColor(.yellow)
Panel("Info", borderStyle: .line, titleColor: .magenta) {
Text("Title in border")
}
}
}
DemoSection("Border Styles") {
HStack(spacing: 1) {
Box(.line) { Text("line") }
Box(.rounded) { Text("rounded") }
Box(.doubleLine) { Text("double") }
Box(.heavy) { Text("heavy") }
Box(.block) { Text("block") }
}
}
Spacer()
}
}
}