3 releases

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

#929 in Command-line interface

Download history

89 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.8–5.5MB
~21K SLoC