Skip to content
Projekte

Über uns

The rsille is a Rust library for drawing graphics in the terminal

Design und Medien

So werden diese Zahlen gemessen

What you can do

  • raster - Yes - An RGB canvas for displaying pixels in terminals that support the Kitty graphics protocol or Sixel.
  • overlay - No - Interactive widgets over a running shell and events for tracking shell commands. Also enables raster.

Gemessener Sternzuwachs

in 24h
+1
in 7 days
+6
in 15 days
+6
in 1 month
+6

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

rsille

English · 中文

crates.io docs.rs homepage license

rsille is a Rust framework for building terminal interfaces with widgets and graphics. You can put buttons, text editors, and a drawing canvas in the same layout, then run it inline at the prompt or as a fullscreen application.

Examples

TUI · Build draggable windows from widgets Canvas · Draw color graphics with Unicode characters
Draggable, resizable windows over Lumen’s 3D workspace A ringed planet drawn with colored Braille characters in Neon Observatory
A first-person voxel world drawn with half-block characters, with a cabin beside a lake
Math rendering · Typeset with Typst and plot with rsille draw overlay · Draw over other TUIs and shells
A Bash prompt running the Typst formula example, with the Gaussian integral rendered below the command
Rotating surfaces, a helix, and a trefoil knot rendered by the function plotter
DeepSeek Pet’s feeding menu open over a Neovim editing session

More runnable examples

Quick start

Build a searchable theme picker

Type li to find Light and press Enter to switch the whole palette to light colors. You can also choose a theme with ↑ / ↓. Press Esc to exit.

Searching for themes and switching between Tokyo Night, Dracula, and Light

Add rsille to your Rust project's Cargo.toml.

[dependencies]
rsille = "3"

Put this in src/main.rs and run cargo run.

use rsille::tui::prelude::*;

fn main() -> WidgetResult<()> {
    App::new(String::from("Tokyo Night"))
        .mode(Mode::Inline)
        .with_theme_from(|name| match name.as_str() {
            "Light" => Theme::light(),
            "Dracula" => Theme::dracula(),
            _ => Theme::tokyo_night(),
        })
        .update(|name, choice, ctx| match choice {
            Some(next) => *name = next,
            None => ctx.exit(),
        })
        .view(|name| {
            command_palette()
                .border(BorderStyle::Rounded)
                .title(format!("Theme · {name}"))
                .placeholder("Search themes")
                .items(["Tokyo Night", "Dracula", "Light"].map(|s| CommandItem::new(s, s)))
                .on_submit(Some)
                .on_close(|| None)
        })
        .run()?;
    Ok(())
}

Try the Playground

Install the separate rsille-playground package and run rsille to open the interactive demo menu.

cargo install rsille-playground --locked
rsille

You can also open the function plotter with rsille draw or launch the terminal pet with rsille pet. See the Playground guide for all commands and supported terminals.

Cargo features

Feature Enabled by default What it adds
raster Yes An RGB canvas for displaying pixels in terminals that support the Kitty graphics protocol or Sixel.
overlay No Interactive widgets over a running shell and events for tracking shell commands. Also enables raster.

To build a shell overlay, enable overlay in Cargo.toml.

[dependencies]
rsille = { version = "3", features = ["overlay"] }

If you only need the core widgets and Unicode canvas, you can set default-features = false on the rsille dependency.

Other resources

Ähnliche Projekte entdecken

Wird geladen…