Rustubble is an ideal Rust library for designing command-line applications. It allows you to create apps in the terminal without dealing with austere and minimalist interfaces.
To do so, this library offers a collection of ultra-handy and customizable components such as:
- TextInput: Advanced text fields supporting Unicode, intuitive copy-pasting, and a wide range of customization options.
- TextArea: Multi-line text areas with scrolling, perfect for longer inputs.
- Spinner: Hypnotic loading animations with many predefined styles and an API to create your own.
- Table: Sortable and paginated tables to display your data clearly and interactively.
- ProgressBar: Aesthetic and informative progress bars to track the advancement of your tasks.
- Timer/Stopwatch: Timers and countdowns to add dynamism to your applications.
- Viewport: A view into your data with smooth scrolling.
- List/MenuList: Interactive lists and menus for intuitive navigation.

Thanks to Rust, known for its speed and security, and the Crossterm library for cross-platform compatibility, Rustubble is high-performance and integrates perfectly with Windows, macOS, and Linux. You’ll benefit from cutting-edge graphical components even in the most minimalistic environments.

Let’s take the Spinner component as an example. With this library, you’ll be spoiled for choice with a multitude of predefined styles in spinner_data.rs
: twirling dots, spinning lines… You can even create your own animations by adjusting the frames and timing.

Each component comes with an intuitive API offering very complete customization options. You can adjust colors, messages, styles, dimensions, margins, and paddings… You have total control over the final output. You start with a solid foundation to build rich and unique interfaces.
It’s entirely open-source and available on GitHub, allowing you to explore the code, contribute to the project, and even add your own components!
Here’s a quick tutorial on how to integrate the Table component into your Rust application:
- Add the Rustubble dependency in your
Cargo.toml
:
[dependencies]
rustubble = "0.1.0"
- Import the Table component:
use rustubble::Table;
- Create a Table instance with headers and data:
let headers = vec!["Name", "Age", "City"];
let data = vec![
vec!["John", "30", "New York"],
vec!["Jane", "25", "Paris"],
vec!["Bob", "40", "London"],
];
let mut table = Table::new(headers, data, 0, 3, 7);
You can customize the padding, the number of visible rows, and the scroll offset.
- Position and display the table in your view:
let (x, y) = (5, 5);
handle_table(&mut table, x, y);
And there you go, in just a few lines, you have a superb interactive table in your command-line application. You can easily adapt it to your needs and style.