Watch the conference talk: Bringing Terminal Aesthetics to the Web With Rust (and Vice Versa)
Ratzilla
Build terminal-themed web applications with Rust and WebAssembly. Powered by Ratatui.
Quickstart
Templates
Install cargo-generate
:
cargo install cargo-generate
Generate a new project:
cargo generate orhun/ratzilla
And then serve the application on your browser ➡️
See templates for more information.
Manual Setup
Add Ratzilla as a dependency in your Cargo.toml
:
Here is a minimal example:
use ;
use ;
use ;
Add your index.html
. During build, trunk
will automatically inject and initialize your Rust code (compiled to
WebAssembly) as a JavaScript module.
<!doctype html>
<!-- (optional) subscribe to the application started event -->
Ratzilla
And then serve the application on your browser ➡️
Serve
Install trunk to build and serve the web application.
Add compilation target wasm32-unknown-unknown
:
Then serve it on your browser:
Now go to http://localhost:8080 and enjoy TUIs in your browser!
Deploy
To build the WASM bundle, you can run the following command:
Then you can serve the server from the dist
directory.
#!/bin/bash
# Install Rustup
|
# Install trunk using binstall
|
# Build project with trunk
Vercel
There is a Vercel deployment template available for Ratzilla here.
Documentation
Examples
- Minimal (Preview)
- Demo (Preview)
- Pong (Preview)
- Colors RGB (Preview)
- Animations (Preview)
- World Map (Preview)
Websites built with Ratzilla
- https://orhun.dev/ratzilla - The official website of Ratzilla
- https://terminalcollective.org - Terminal Collective community website
- https://www.function-type.com/tusistor - Resistor calculator
- http://timbeck.me - Personal website of Tim Beck
- https://jetpham.com - Conway's Game of Life
- https://map.apt-swarm.orca.toys - Map of apt-swarm p2p locations
- TachyonFX FTL - DSL editor and previewer for TachyonFX effects
- https://emrecansuster.com - Personal website of Emrecan Şuşter (source)
Acknowledgements
Thanks to Webatui projects for the inspiration and the initial implementation of the essential parts of DOM backend.
Special thanks to Martin Blasko for his huge help and contributions.
Lastly, thanks to Ratatui for providing the core TUI components.
Contributing
Pull requests are welcome!
Consider submitting your ideas via issues first and check out the existing issues.
License
Licensed under either of Apache License Version 2.0 or The MIT License at your option.
🦀 ノ( º _ º ノ) - respect crables!
Copyright
Copyright © 2025, Orhun Parmaksız