Home

Awesome

Cursive

crates.io Rust MIT licensed Gitter chat

Cursive is a TUI (Text User Interface) library for rust. It uses the crossterm backend by default, but other backends are available.

It allows you to build rich user interfaces for terminal applications.

Documentation

It is designed to be safe and easy to use:

[dependencies]
cursive = "0.21"

Or to use the latest git version:

[dependencies]
cursive = { git = "https://github.com/gyscos/cursive" }
use cursive::views::{Dialog, TextView};

fn main() {
    // Creates the cursive root - required for every application.
    let mut siv = cursive::default();

    // Creates a dialog with a single "Quit" button
    siv.add_layer(Dialog::around(TextView::new("Hello Dialog!"))
                         .title("Cursive")
                         .button("Quit", |s| s.quit()));

    // Starts the event loop.
    siv.run();
}

Cursive dialog example

Check out the other examples to get these results, and more:

<div> <a href="https://github.com/gyscos/cursive/blob/main/cursive/examples/lorem.rs"><img src="https://imgur.com/hW9M9MV.png" alt="lorem.rs example", width="48%" /></a> <a href="https://github.com/gyscos/cursive/blob/main/cursive/examples/menubar.rs"><img src="https://imgur.com/xx3lZPz.png" alt="menubar.rs example", width="48%" /></a> <a href="https://github.com/gyscos/cursive/blob/main/cursive/examples/select.rs"><img src="https://imgur.com/couty0n.png" alt="select.rs example", width="48%" /></a> <a href="https://github.com/gyscos/cursive/blob/main/cursive/examples/mines/"><img src="https://imgur.com/vNteYyy.png" alt="mines example", width="48%" /></a> <a href="https://github.com/gyscos/cursive/blob/main/cursive/examples/theme_manual.rs"><img src="https://i.imgur.com/I9V5KRi.png" alt="theme_manual.rs example", width="48%" /></a> <a href="https://github.com/gyscos/cursive/blob/main/cursive-syntect/examples/parse.rs"><img src="https://i.imgur.com/a8bfe5s.png" alt="syntect example" width="48%" /></a> </div>

(Colors may depend on your terminal configuration.)

Tutorials

These tutorials may help you get started with cursive:

Third-party views

Here are a few crates implementing new views for you to use:

Showcases

Here are some cool applications using cursive:

Goals

Compatibility

First off, terminals are messy. A small set of features is standard, but beyond that, almost every terminal has its own implementation.

Output

Input

Contributing

Alternatives

See also ratatui - and a small comparison page.