mirror of
https://github.com/phranck/TUIkit.git
synced 2026-05-21 09:50:35 +00:00
45e73faafb
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.
47 lines
1.4 KiB
Swift
47 lines
1.4 KiB
Swift
//
|
|
// TextStylesPage.swift
|
|
// TUIKitExample
|
|
//
|
|
// Demonstrates text styling capabilities.
|
|
//
|
|
|
|
import TUIKit
|
|
|
|
/// Text styles demo page.
|
|
///
|
|
/// Shows various text styling options including:
|
|
/// - Basic styles (bold, italic, underline, etc.)
|
|
/// - Combined styles
|
|
/// - Special effects (blink, inverted)
|
|
struct TextStylesPage: View {
|
|
var body: some View {
|
|
VStack(spacing: 1) {
|
|
HeaderView(title: "Text Styles Demo")
|
|
|
|
DemoSection("Basic Styles") {
|
|
Text("Normal text - no styling applied")
|
|
Text("Bold text").bold()
|
|
Text("Italic text").italic()
|
|
Text("Underlined text").underline()
|
|
Text("Strikethrough text").strikethrough()
|
|
Text("Dimmed text").dim()
|
|
}
|
|
|
|
DemoSection("Combined Styles") {
|
|
Text("Bold + Italic").bold().italic()
|
|
Text("Bold + Underline").bold().underline()
|
|
Text("Bold + Color").bold().foregroundColor(.cyan)
|
|
Text("Italic + Dim").italic().dim()
|
|
Text("All combined").bold().italic().underline().foregroundColor(.magenta)
|
|
}
|
|
|
|
DemoSection("Special Effects") {
|
|
Text("Blinking text (if terminal supports)").blink()
|
|
Text("Inverted colors").inverted()
|
|
}
|
|
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|