Aisling
Embeddable terminal text effects for Rust TUI applications.
Aisling renders animated text effects as plain Rust data. It does not own your terminal, start an event loop, sleep, or print unless you run the included examples. Your app drives the iterator and maps each styled Frame into Ratatui, Crossterm, ANSI output, tests, logs, or any custom renderer.
The effect catalog is ported from the Python terminaltexteffects project shape and includes every built-in reference effect exposed by the current snapshot.
Install
After publishing:
Or in Cargo.toml:
[]
= "0.1"
For local development from this repository:
[]
= { = "../aisling" }
Quick Start
use ;
let config = default
.with_duration
.with_seed;
let effect = with_config;
for frame in effect.iter
TUI Integration
Effect::iter() yields Frame values. A Frame is a fixed-size grid with row-major Cell data.
Important types:
| Type | Purpose |
|---|---|
Effect |
Owns the effect kind, input text, and config. |
EffectKind |
Selects one of the built-in effects. |
EffectConfig |
Controls duration, seed, gradient, canvas size, color handling, and more. |
Frame |
Rendered 2D grid for a single animation tick. |
Cell |
Character plus foreground/background colors and simple styles. |
Color, Gradient, Easing |
Color and timing helpers. |
Minimal renderer loop shape:
use ;
let effect = new;
for frame in effect.iter
Effects
All built-in effects are available through EffectKind and EffectKind::all().
| Command | Enum |
|---|---|
beams |
EffectKind::Beams |
binarypath |
EffectKind::BinaryPath |
blackhole |
EffectKind::Blackhole |
bouncyballs |
EffectKind::BouncyBalls |
bubbles |
EffectKind::Bubbles |
burn |
EffectKind::Burn |
colorshift |
EffectKind::ColorShift |
crumble |
EffectKind::Crumble |
decrypt |
EffectKind::Decrypt |
errorcorrect |
EffectKind::ErrorCorrect |
expand |
EffectKind::Expand |
fireworks |
EffectKind::Fireworks |
highlight |
EffectKind::Highlight |
laseretch |
EffectKind::LaserEtch |
matrix |
EffectKind::Matrix |
middleout |
EffectKind::MiddleOut |
orbittingvolley |
EffectKind::OrbittingVolley |
overflow |
EffectKind::Overflow |
pour |
EffectKind::Pour |
print |
EffectKind::Print |
rain |
EffectKind::Rain |
randomsequence |
EffectKind::RandomSequence |
rings |
EffectKind::Rings |
scattered |
EffectKind::Scattered |
slice |
EffectKind::Slice |
slide |
EffectKind::Slide |
smoke |
EffectKind::Smoke |
spotlights |
EffectKind::Spotlights |
spray |
EffectKind::Spray |
swarm |
EffectKind::Swarm |
sweep |
EffectKind::Sweep |
synthgrid |
EffectKind::SynthGrid |
thunderstorm |
EffectKind::Thunderstorm |
unstable |
EffectKind::Unstable |
vhstape |
EffectKind::VhsTape |
waves |
EffectKind::Waves |
wipe |
EffectKind::Wipe |
String parsing is supported:
use FromStr;
use EffectKind;
let kind = from_str.unwrap;
assert_eq!;
Configuration
use ;
let config = default
.with_duration
.with_seed
.with_canvas_size
.with_gradient;
Notable EffectConfig fields:
| Field | Meaning |
|---|---|
duration |
Number of animation frames. |
hold_final_frames |
Extra frames that hold the final text. |
seed |
Deterministic random seed for repeatable playback. |
gradient |
Final/effect color gradient. |
gradient_direction |
Horizontal, vertical, diagonal, or radial mapping. |
easing |
Global easing used by many effect renderers. |
existing_color_handling |
Preserve or ignore parsed ANSI input colors. |
no_color |
Disable color output. |
canvas_width, canvas_height |
Optional fixed frame dimensions. |
tab_width |
Spaces per tab when parsing input text. |
ANSI Input
Aisling parses common ANSI SGR sequences in input text, including foreground/background 3-bit, bright 3-bit, 8-bit xterm, and 24-bit RGB colors. Parsed styling is kept in each final Cell when the color-handling mode allows it.
use ;
let effect = new;
let final_frame = effect.final_frame;
assert_eq!;
Examples
Run a single effect in the terminal:
Use the helper script while developing locally:
Run the multi-pane all-effects showcase:
test.sh launches the showcase with a longer embedded text sample:
Package Verification
Before publishing:
Publish when ready:
License
MIT