tachyonfx
A ratatui library for creating shader-like effects in terminal UIs. Build complex animations by composing and layering simple effects, bringing smooth transitions and visual polish to the terminal.

✨ Features
- 25 unique effects — color transformations, text animations, geometric distortions, plus support for custom effects
- Shader-like API — effects operate on rendered cells, allowing complex visual transformations
- Effect composition — chain and combine effects for sophisticated animations
- Interactive browser editor — design and preview effects in real-time with TachyonFX FTL
- Runtime effect compilation — create effects from strings using the built-in DSL
- Cell-precise targeting — apply effects to specific regions or cells matching custom criteria
🚀 Quick Start
Add tachyonfx to your Cargo.toml:
Create your first effect:
use ;
use ;
use ;
📸 Examples
Explore the examples to see effects in action:
# Basic effects showcase
# Interactive DSL playground
# Effect timeline visualization
# Minimal setup example
🎯 Getting Started
Try it in your browser
TachyonFX FTL is a browser-based editor for creating and tweaking effects in real-time.
Basic Concepts
- Effects are stateful — Create once, apply every frame
- Effects transform rendered content — Apply after widgets render
- Effects compose — Build complex animations from simple pieces
Simple Example: Fade In
use ;
// Create a fade-in effect
let mut fade = fade_from;
// Apply to red text only
fade.set_cell_filter;
// In your render loop
fade.process;
Combining Effects
// Run multiple effects in parallel
let effects = parallel;
// Or sequence them
let effects = sequence;
Using the DSL
Create effects from strings at runtime:
use EffectDsl;
let effect = new
.compiler
.compile
.expect;
📦 Effect Reference
Color Effects
Transform colors over time for smooth transitions.
fade_from/fade_to— Transition colorsfade_from_fg/fade_to_fg— Foreground color transitionshsl_shift— Animate through HSL color spaceterm256_colors— Downsample to 256-color mode
Text & Motion Effects
Animate text and cell positions for dynamic content.
coalesce/dissolve— Text materialization effectsslide_in/slide_out— Directional sliding animationssweep_in/sweep_out— Color sweep transitionsexplode— Particle dispersion effect
Control Effects
Fine-tune timing and behavior.
parallel— Run multiple effects simultaneouslysequence— Chain effects one after anotherrepeat— Loop effects with optional limitsping_pong— Play forward then reversewith_duration— Override effect duration
Geometry Effects
Transform positions and layout.
translate— Move content by offsetresize_area— Scale effect boundstranslate_buf— Copy and move buffer content
🔧 Advanced Features
Cell Filtering
Apply effects selectively:
// Only apply to cells with specific colors
dissolve
.with_filter
// Target specific regions
let filter = AllOf;
Custom Effects
Create your own effects:
effect_fn
Alternatively, implement the Shader trait and use it together with .into_effect().
Effect DSL
The DSL supports:
- Most built-in effects (excludes:
effect_fn,effect_fn_buf,glitch,offscreen_buffer,resize_area,translate,translate_buf) - Variable bindings
- Method chaining
- Complex compositions
let expr = r#"
let duration = 300;
fx::sequence(&[
fx::fade_from(black, white, duration),
fx::dissolve(duration)
])
"#;
🛠️ Configuration
Features
dsl— Effect DSL support (enabled by default)sendable— Make effectsSend(but notSync)std-duration— Usestd::time::Durationinstead of 32-bit custom typeweb-time— WebAssembly compatibility
🤝 Contributing
Contributions welcome! Please check existing issues or create new ones to discuss changes.
📝 License
MIT License - see LICENSE for details.