2 unstable releases

0.2.0 Jun 5, 2023
0.1.0 Mar 22, 2022

#300 in Command-line interface

Download history 218/week @ 2024-01-23 441/week @ 2024-01-30 387/week @ 2024-02-06 239/week @ 2024-02-13 332/week @ 2024-02-20 241/week @ 2024-02-27 204/week @ 2024-03-05 416/week @ 2024-03-12 1028/week @ 2024-03-19 623/week @ 2024-03-26 914/week @ 2024-04-02 222/week @ 2024-04-09 381/week @ 2024-04-16 956/week @ 2024-04-23 657/week @ 2024-04-30 251/week @ 2024-05-07

2,281 downloads per month
Used in stoic


3.5K SLoC

A component-based framework for building Rust Text-based User Interfaces (TUIs)

There are several copies of this repo on GitHub, facebookincubator/superconsole is the canonical one.

The superconsole framework provides a powerful line based abstraction over text based rendering to the terminal. It also provides basic building blocks like line manipulation, and a higher level of composable components. A base set of "batteries" components are included to help developers create Text-based User Interfaces (TUIs) as quickly as possible.

The design choices that underly superconsole are selected to prioritize testability, ease of composition, and flexibility.

Superconsole also offers stylization, including italics, underlining, bolding, and coloring text. Furthermore, relying on crossterm ensures that it is compatible with Windows, Unix, and MacOS.

Finally, superconsole delineates between rendering logic and program state - each render call accepts an immutable reference to state, which components may use to inject state into their otherwise immutable rendering logic.


Superconsole running some buck2 tests


use std::convert::TryInto;
use superconsole::components::bordering::{Bordered, BorderedSpec};
use superconsole::{Component, Dimensions, DrawMode, Lines, SuperConsole};

struct HelloWorld;

impl Component for HelloWorld {
    fn draw_unchecked(&self, _dimensions: Dimensions, _mode: DrawMode) -> anyhow::Result<Lines> {
            vec!["Hello world!".to_owned()].try_into().unwrap(),

pub fn main() -> anyhow::Result<()> {
    let bordering = BorderedSpec::default();
    let mut superconsole = SuperConsole::new().ok_or_else(|| anyhow::anyhow!("Not a TTY"))?;
    let component = Bordered::new(HelloWorld, bordering);

See the CONTRIBUTING file for how to help out.


Superconsole is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.


~485K SLoC