3 releases

0.1.2 Mar 10, 2024
0.1.1 Feb 9, 2024
0.1.0 Feb 7, 2024

#428 in Command-line interface

Download history 2/week @ 2024-02-05 16/week @ 2024-02-19 30/week @ 2024-02-26 98/week @ 2024-03-04 56/week @ 2024-03-11 50/week @ 2024-04-01

204 downloads per month

Custom license

28KB
615 lines

crates.io Released API docs

Karsa

Karsa is a lightweight terminal user interface (TUI) library built on top of crossterm.

Features

  • Low dependency
  • User friendly API
  • Render loop
  • Mouse support
  • Multiple widgets

Widgets

  • Table
  • Tabs
  • Text (with styling)
  • WidgetBox

Demo

$ cargo run --example table

lib.rs:

Easy, lightweight and feature rich TUI library for rust.

Features

  • Lightweight
  • User friendly API
  • Render loop
  • Mouse support
  • Multiple widgets

Get started

Adding karsa as a dependency

[dependencies]
karsa = "0.1.2"

Create a box with text and a title

use karsa::renderloop::run;
use karsa::widgets::{text::Text, widgetbox::WidgetBox};
use std::io;

fn main() -> io::Result<()> {
   let text = Text::builder()
       .with_content("Hello from\nkarsa\n!".to_string())
       .build();

   let widgetbox = WidgetBox::new(text, None, None, Some("Title".to_string()));
   run(widgetbox)?;
   Ok(())
}
This crate is in (very) early stage and might be subject to major API changes

Dependencies

~0.9–7MB
~20K SLoC