mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
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.
41 lines
1.1 KiB
Swift
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)
|
|
}
|
|
}
|
|
}
|
|
}
|