1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Animated skeleton loading widgets for [Ratatui](https://ratatui.rs).
//!
//! Provides placeholder widgets that pulse, sweep, or shimmer while data loads.
//! All widgets are stateless — pass `elapsed_ms` from your event loop and the
//! animation state is computed purely from the timestamp.
//!
//! # Widgets
//!
//! - [`SkeletonBlock`] — Solid filled rectangle (atomic unit)
//! - [`SkeletonTable`] — Rows with column separators and zebra striping
//! - [`SkeletonList`] — Short spaced items with ragged edges (menu/sidebar)
//! - [`SkeletonText`] — Paragraph simulation with varying line widths
//! - [`SkeletonStreamingText`] — Typewriter-style chat text filling over time
//! - [`SkeletonBarChart`] — Vertical bars of varying height
//! - [`SkeletonHBarChart`] — Horizontal bars of varying length
//! - [`SkeletonKvTable`] — Key-value pairs (properties/detail panel)
//! - [`SkeletonLineChart`] — Braille line chart with overlapping wave traces
//!
//! # Example
//!
//! ```rust
//! use tui_skeleton::{SkeletonBlock, AnimationMode, Color};
//!
//! let elapsed_ms = 1000u64;
//! let widget = SkeletonBlock::new(elapsed_ms)
//! .mode(AnimationMode::Breathe)
//! .base(Color::Rgb(30, 22, 58))
//! .highlight(Color::Rgb(49, 40, 78));
//! ```
//!
//! # Adaptive Tick Rate
//!
//! Skeleton animations look best at ~20 FPS ([`TICK_ANIMATED`]) but most TUI
//! applications tick at ~5 FPS ([`TICK_IDLE`]) for static content. The
//! recommended pattern:
//!
//! 1. Track whether any skeleton widget is currently visible
//! 2. Use [`TICK_ANIMATED`] when skeletons are on screen
//! 3. Revert to [`TICK_IDLE`] when all data has loaded
//!
//! This keeps CPU usage low while delivering smooth animations during loading.
pub
pub use AnimationMode;
pub use SkeletonBarChart;
pub use SkeletonBlock;
pub use SkeletonHBarChart;
pub use SkeletonKvTable;
pub use SkeletonLineChart;
pub use SkeletonList;
pub use SkeletonStreamingText;
pub use SkeletonTable;
pub use SkeletonText;
// Re-export types consumers need so they never depend on ratatui-core/ratatui-widgets directly.
pub use Constraint;
pub use Color;
pub use Block;
use Duration;
/// Recommended tick interval when skeleton widgets are visible (50ms / 20 FPS).
pub const TICK_ANIMATED: Duration = from_millis;
/// Recommended tick interval for static content (200ms / 5 FPS).
pub const TICK_IDLE: Duration = from_millis;
/// Default colors that work on both dark and light terminals.