https://github.com/tsoding/rcui
Simple TUI framework in Rust
https://github.com/tsoding/rcui
Last synced: 2 months ago
JSON representation
Simple TUI framework in Rust
- Host: GitHub
- URL: https://github.com/tsoding/rcui
- Owner: tsoding
- License: mit
- Created: 2020-11-03T13:40:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-17T06:33:24.000Z (over 4 years ago)
- Last Synced: 2025-04-29T12:15:50.431Z (2 months ago)
- Language: Rust
- Homepage:
- Size: 133 KB
- Stars: 36
- Watchers: 2
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/tsoding/rcui/actions)
# rcui
Simple TUI framework in Rust.
## Example
Item List with 100 elements and vim-like navigation
```rust
use rcui::*;fn main() {
Rcui::exec(Proxy::wrap(
|list, context, event| match event {
Event::KeyStroke(key) => match *key as u8 as char {
'q' => context.quit(),
'j' => list.down(),
'k' => list.up(),
_ => {}
}_ => {}
},
ItemList::new((0..100).map(|x| format!("item-{:02}", x)).collect()),
));
println!("Quitting gracefully uwu");
}
```## Quick Start
```console
$ cargo run --example 01_grid
$ cargo run --example 02_item_list
```