| Crates.io | ratatui-wasm-backend |
| lib.rs | ratatui-wasm-backend |
| version | 0.1.1 |
| created_at | 2025-05-04 20:53:00.128668+00 |
| updated_at | 2025-05-05 07:18:50.021434+00 |
| description | Allows writing Ratatui terminal apps that target WASM. |
| homepage | |
| repository | https://github.com/NfNitLoop/ratatui-wasm-backend |
| max_upload_size | |
| id | 1659922 |
| size | 30,063 |
A Backend implementation for Ratatui targeting WASM.
The goals of this implementation are:
Backend trait which can run in WASM.Known issues:
The basic process is:
AnsiBackend instance. This currently needs 2 arguments:
.exclusive() method.Terminal, passing it the above backend.AnsiBackend.normal())Process stdin in Rust.
You can do it in JavaScript. But for every type of event you need to send across the JavaScript/Rust boundary, you'll potentially need to make a new typescript type, or a new wasm-bindgen method. I just start up an async loop in JavaScript to grab bytes from stdin (Don't forget to set "raw mode"!), and shove bytes into my Rust app for it to handle & rerender.
This repository contains example code that uses this backend. See:
Or have a look at the screen recording