Files
TUIkit/Sources/TUIkitExample/Pages/SpinnersPage.swift
T
phranck df4ee3253b Feat: AppHeader — framework-managed header bar rendered outside the view tree
AppHeader is rendered at the top of the terminal by RenderLoop, similar to
StatusBar at the bottom. Views declare header content via .appHeader { }
ViewBuilder modifier. Supports standard (thin divider) and block (half-block
with appHeaderBackground) appearance. Hidden when no content is set.
Diff cache invalidates on header height changes to prevent ghosting.
2026-02-03 21:21:41 +01:00

41 lines
1.1 KiB
Swift

// 🖥️ TUIKit — Terminal UI Kit for Swift
// SpinnersPage.swift
//
// Created by LAYERED.work
// CC BY-NC-SA 4.0
import TUIkit
/// A demo page showing all Spinner styles.
struct SpinnersPage: View {
var body: some View {
VStack(alignment: .leading, spacing: 1) {
DemoSection("Dots (Braille Rotation)") {
Spinner("Loading data...")
}
DemoSection("Line (ASCII Rotation)") {
Spinner("Compiling...", style: .line)
}
DemoSection("Bouncing (Knight Rider)") {
Spinner("Processing...", style: .bouncing)
}
DemoSection("Custom Color") {
Spinner("Installing...", style: .bouncing, color: .palette.success)
}
Spacer()
}
.appHeader {
HStack {
Text("Spinners").bold().foregroundColor(.palette.accent)
Spacer()
Text("TUIkit v\(tuiKitVersion)").foregroundColor(.palette.foregroundTertiary)
}
}
}
}