#terminal #ratatui #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

#89 in #ratatui

Download history 26/week @ 2024-09-11 15/week @ 2024-09-18 14/week @ 2024-09-25 3/week @ 2024-10-02

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
~324K SLoC