gitmyhub

tui-rs

Rust ★ 11k updated 2y ago ▣ archived

Build terminal user interfaces and dashboards using Rust

tui-rs is an archived Rust library for building visual dashboards and tool interfaces that run inside a terminal window, with charts, tables, and progress bars, new projects should use the community fork ratatui instead.

Rustcrosstermtermionsetup: moderatecomplexity 2/5

tui-rs is a Rust library that lets developers build visual interfaces that run entirely inside a terminal window, rather than in a web browser or desktop GUI. Think of programs like file managers, system monitors, or database tools that display organized panels, charts, and menus inside a plain terminal. That is what this library was built to produce.

An important note up front: as of August 2023, this project is no longer maintained. The community has moved to an actively maintained fork called ratatui. If you are starting a new project, the README directs you there instead.

The library works by redrawing the entire screen on every update, using an internal buffer system to figure out which parts of the display actually changed and only sending those updates to the terminal. This keeps things fast even though Rust programs can render very quickly. The library does not handle keyboard or mouse input on its own. Developers pair it with separate input libraries for that.

Out of the box it includes a set of ready-made visual building blocks: blocks with borders, progress gauges, sparkline mini-charts, full line charts, bar charts, scrollable lists, tables, text paragraphs, a canvas for drawing points and lines, and tabbed views. These can be combined to build complex dashboards or tool interfaces.

The library runs on top of two different terminal backends, crossterm (the default, which works on Windows, macOS, and Linux) and termion (Linux and macOS only). Developers choose which one fits their project.

Many well-known terminal tools were built with tui-rs, including a Spotify client, a Git interface, a network bandwidth monitor, a Docker container manager, and a database browser, among others. The long list in the README shows how broadly it was adopted before the maintenance shift.

The code is released under the MIT license, which allows free use in both personal and commercial projects.

Where it fits