Expand description
Animated skeleton loading widgets for Ratatui.
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 stripingSkeletonList— Short spaced items with ragged edges (menu/sidebar)SkeletonText— Paragraph simulation with varying line widthsSkeletonBarChart— Vertical bars of varying heightSkeletonHBarChart— Horizontal bars of varying lengthSkeletonKvTable— Key-value pairs (properties/detail panel)SkeletonLineChart— Braille line chart with overlapping wave traces
§Example
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:
- Track whether any skeleton widget is currently visible
- Use
TICK_ANIMATEDwhen skeletons are on screen - Revert to
TICK_IDLEwhen all data has loaded
This keeps CPU usage low while delivering smooth animations during loading.
Modules§
- defaults
- Default colors that work on both dark and light terminals.
Structs§
- Block
- A widget that renders borders, titles, and padding around other widgets.
- Skeleton
BarChart - Skeleton vertical bar chart with bars of varying height.
- Skeleton
Block - Solid filled rectangle with animated brightness.
- SkeletonH
BarChart - Skeleton horizontal bar chart with bars of varying length.
- Skeleton
KvTable - Skeleton key-value table (properties panel / detail view).
- Skeleton
Line Chart - Skeleton line chart rendered with braille traces over filled area.
- Skeleton
List - Skeleton list with short, spaced items and ragged right edges.
- Skeleton
Table - Skeleton table with rows, column separators, and optional zebra striping.
- Skeleton
Text - Skeleton paragraph with lines of varying width.
Enums§
- Animation
Mode - Animation style for skeleton loading widgets.
- Color
- ANSI Color
- Constraint
- A constraint that defines the size of a layout element.
Constants§
- TICK_
ANIMATED - Recommended tick interval when skeleton widgets are visible (50ms / 20 FPS).
- TICK_
IDLE - Recommended tick interval for static content (200ms / 5 FPS).