News

Ratatui gets Typst backend, Rust TUI apps can render in PDFs

A barebones Ratatui Typst package can turn terminal apps into live-updating PDFs, widening where Rust TUIs can ship.

Jamie Taylor··2 min read
Published
Listen to this article0:00 min
Share this article:
Ratatui gets Typst backend, Rust TUI apps can render in PDFs
AI-generated illustration

A Rust terminal app rendering inside a PDF sounds like a stunt until you see the workflow it opens up. Samuel Åkesson, who goes by Sermuns, built Ratatypst as a proof of concept to render Ratatui apps through Typst, and the result is already live enough to matter: interactive TUI output can now be pushed into a document format that can be exported, previewed, and regenerated as files change.

The project’s own description is blunt, calling it a “PoC Typst package to render Ratatui apps” and, in the repository, “a terribly barebones and shitty proof-of-concept for writing Ratatui apps for Typst.” Åkesson described it in a Typst Forum showcase as “a very silly project that works surprisingly well,” which fits the appeal here. Typst supports WebAssembly plugins, and plugin functions must be compiled to 32-bit shared WebAssembly libraries. That matters because it gives Ratatypst a real bridge into Typst’s document engine rather than a one-off export hack. Typst can export to PDF, PNG, SVG, or HTML, and its watch and preview workflow can automatically recompile documents when source files change, making the setup feel closer to a living document pipeline than a static render.

For Ratatui, the extension is especially on-brand. The crate’s backend system is built around swappable backends that handle rendering and input capture, and the project has already supported Crossterm, Termion, and Termwiz. Ratatui 0.30 pushed that modular direction further with ratatui-core and backend crates split apart, a structure that makes unusual targets like Typst easier to imagine. That flexibility traces back to Ratatui’s fork from tui-rs in February 2023, done with Florian Dehau’s blessing, and it explains why the ecosystem keeps attracting experiments that go beyond the terminal window.

Orhun Parmaksız, a Ratatui maintainer and open-source developer, demoed the project, underscoring how the library is being pushed toward embedded devices and other platforms as well as the shell. The Ratatypst repository was created just last week and was still changing quickly, with documentation and calling-convention edits landing within hours, a sign that this remains early proof-of-concept work. Even so, the direction is clear: Ratatui is no longer only about terminal interfaces. With Typst in the mix, Rust TUIs can now aim at PDFs, shareable reports, and document-driven tooling, which opens a fresh path for apps that need both interactivity and a polished artifact at the end.

Know something we missed? Have a correction or additional information?

Submit a Tip

Never miss a story.

Get Rust Programming updates weekly. The top stories delivered to your inbox.

Free forever · Unsubscribe anytime

Discussion

More Rust Programming News