Expand description
A Ratatui widget for retro split-flap display boards.
Animated character tiles flip through an ordered character set, recreating the mechanical departure boards found at airports and train stations.
§Quick start
use tui_splitflap::{FlapBoardState, FlapMessage};
let mut state = FlapBoardState::new(1, 20);
state.set_message(&FlapMessage::single("HELLO WORLD"));
// Advance by elapsed milliseconds each frame; returns true while animating.
let still_animating = state.tick(16);Render by passing FlapBoard (a ratatui::widgets::StatefulWidget) and &mut state
to frame.render_stateful_widget in your draw callback.
§Animation styles
Configured via FlapBoardState::with_flip_style:
| Style | Description |
|---|---|
FlipStyle::Sequential | Cycles every intermediate character; duration scales with distance |
FlipStyle::Mechanical | Split-block animation; constant duration regardless of distance |
FlipStyle::Combined | Mechanical phase, then sequential roll to the target character |
Structs§
- CharSet
- Ordered sequence of characters a split-flap tile can display.
- Flap
Board - Stateless widget that renders a split-flap board from
FlapBoardState. - Flap
Board State - Owns all per-cell animation state for a split-flap board.
Driven externally via
tick()andset_message(). - Flap
Cell - Per-cell animation state for a single split-flap tile.
- Flap
Message - A message to display on the board, with optional per-message overrides.
- Flap
Theme - Color configuration for the split-flap board.
Enums§
- Cell
Width - Terminal columns per tile.
- Char
SetError - Flip
Phase - What a cell is currently doing — determines how the widget renders it.
- Flip
Style - Animation behavior for a cell flip.
Type Aliases§
- Result
- Convenience alias for results that fail with
CharSetError.