Files
TUIkit/Sources/TUIkitExample/Pages/SpinnersPage.swift
T
phranck 2cdb0dd3db Refactor: Simplify Spinner API — remove speed, track width, and trail length enums
Radically simplify the Spinner public API from 6 parameters to 3.
Remove SpinnerSpeed, BouncingTrackWidth, and BouncingTrailLength enums.
Hardcode calibrated intervals (dots 110ms, line 140ms, bouncing 100ms),
fixed track width (9), and trail opacities with edge overshoot for
smooth fade-in/fade-out at track edges.
2026-02-02 20:25:38 +01:00

36 lines
850 B
Swift

//
// SpinnersPage.swift
// TUIkitExample
//
// Demo page showcasing the Spinner view with all three styles.
//
import TUIkit
/// A demo page showing all Spinner styles.
struct SpinnersPage: View {
var body: some View {
VStack(alignment: .leading, spacing: 1) {
HeaderView(title: "Spinners")
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: .green)
}
Spacer()
}
}
}