#ratatui #terminal #tui #console #cli

ratatui-calloop

A small library for building calloop EventLoop based Ratatui applications

3 unstable releases

0.2.0 Jul 8, 2024
0.1.1 Jun 21, 2024
0.1.0 Jun 21, 2024

#65 in #ratatui

Download history 220/week @ 2024-06-20 2/week @ 2024-06-27 105/week @ 2024-07-04 15/week @ 2024-07-11

128 downloads per month

MIT/Apache

17KB
216 lines

Ratatui-calloop

An experiment with using Calloop to drive a Ratatui app.

Usage

gh repo clone https://github.com/joshka/ratatui-calloop
cargo run --example demo

Example

https://github.com/joshka/ratatui-calloop/blob/main/examples/demo/main.rs

TODO / Ideas

  • Add user events / channel for interaction between multiple parts of the app
  • More complex app

lib.rs:

Ratatui-calloop is an experimental library for building terminal applications using the Calloop event loop.

This library provides a simple API for building terminal applications using the calloop event loop. It is built on top of the ratatui library, which provides a high-level API for building terminal applications. The ratatui-calloop library provides an implementation of the App trait that is compatible with the calloop event loop, allowing you to build terminal applications that respond to user input and update the terminal in real-time.

Example

The following is a simple example of a terminal application that displays a counter and responds to key events to increment or decrement the counter. The application uses the ratatui-calloop library to handle the event loop and update the terminal.

Features

Dependencies

~12–22MB
~325K SLoC