• Stars
    star
    459
  • Rank 95,377 (Top 2 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 3 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ‘‘ tui-rs framework to build stateful applications with a React/Elm inspired approach

tui-realm

~ A tui-rs framework inspired by Elm and React ~

Get started ยท Standard Library ยท Documentation

Developed by @veeso

Current version: 1.9.0 (14/08/2022)

License-MIT Repo stars Downloads counter Latest version Ko-fi

Crossterm CI Termion CI Crossterm CI Termion CI Crossterm CI (Windows) Coveralls Docs



About tui-realm ๐Ÿ‘‘

tui-realm is a framework for tui and ratatui to simplify the implementation of terminal user interfaces adding the possibility to work with re-usable components with properties and states, as you'd do in React. But that's not all: the components communicate with the ui engine via a system based on Messages and Events, providing you with the possibility to implement update routines as happens in Elm. In addition, the components are organized inside the View, which manages mounting/umounting, focus and event forwarding for you.

And that's also explains the reason of the name: Realm stands for React and Elm.

tui-realm also comes with a standard library of components, which can be added to your dependencies, that you may find very useful. Don't worry, they are optional if you don't want to use them ๐Ÿ˜‰, just follow the guide in get started.

Demo

See tui-realm in action in the Example or if you want to read more about tui-realm start reading the official guide HERE.

Features ๐ŸŽ

  • โŒจ๏ธ Event-driven
  • โš›๏ธ Based on React and Elm
  • ๐Ÿฒ Boilerplate code
  • ๐Ÿš€ Quick-setup
  • ๐ŸŽฏ Single focus and states management
  • ๐Ÿ™‚ Easy to learn
  • ๐Ÿค– Adaptable to any use case

Get started ๐Ÿ

โš ๏ธ Warning: currently tui-realm supports these backends: crossterm, termion

Add tui-realm to your Cargo.toml ๐Ÿฆ€

If you want the default features, just add tuirealm 1.x version:

tuirealm = "^1.9.0"

otherwise you can specify the features you want to add:

tuirealm = { version = "^1.9.0", default-features = false, features = [ "derive", "serialize", "with-termion" ] }

Supported features are:

  • derive (default): add the #[derive(MockComponent)] proc macro to automatically implement MockComponent for Component. Read more.
  • serialize: add the serialize/deserialize trait implementation for KeyEvent and Key.
  • tui: use the tui-rs terminal UI library
  • ratatui: use the ratatui terminal UI library
  • crossterm: use the crossterm terminal backend
  • termion: use the termion terminal backend

Deprecated feature flags:

  • with-crossterm
  • with-termion

โš ๏ธ You can enable only one backend at the time and at least one must be enabled in order to build.
โ— You don't need tui as a dependency, since you can access to tui types via use tuirealm::tui::

Enabling other backends โš ๏ธ

This library supports two backends: crossterm and termion, and two high level terminal TUI libraries: tui and ratatui. Whenever you explicitly declare any of the TUI library or backend feature sets you should disable the crate's default features.

โ— You can never have more than one backend and one UI library enabled at the same time

Example using the termion backend:

tuirealm = { version = "^1.9.0", default-features = false, features = [ "termion", "derive", "tui" ] }

Example using the ratatui UI library:

tuirealm = { version = "^1.9.0", default-features = false, features = [ "ratatui", "derive", "crossterm" ]}

Create a tui-realm application ๐Ÿช‚

View how to implement a tui-realm application in the related guide.

Run examples ๐Ÿ”

Still confused about how tui-realm works? Don't worry, try with the examples:

  • demo: a simple application which shows how tui-realm works

    cargo run --example demo

Standard components library ๐ŸŽจ

Tui-realm comes with an optional standard library of components I thought would have been useful for most of the applications. If you want to use it, just add the tui-realm-stdlib to your Cargo.toml dependencies.

Community components ๐Ÿ˜๏ธ

These components are not included in tui-realm, but have been developed by other users. I like advertising other's contents, so here you can find a list of components you may find useful for your next tui-realm project ๐Ÿ’œ.

Want to add yours? Open an issue using the New app/component template ๐Ÿ˜„


Guides ๐ŸŽ“


Documentation ๐Ÿ“š

The developer documentation can be found on Rust Docs at https://docs.rs/tuirealm


Apps using tui-realm ๐Ÿš€

Want to add yours? Open an issue using the New app/component template ๐Ÿ˜„


Support the developer โ˜•

If you like tui-realm and you're grateful for the work I've done, please consider a little donation ๐Ÿฅณ

You can make a donation with one of these platforms:

ko-fi PayPal bitcoin


Contributing and issues ๐Ÿค๐Ÿป

Contributions, bug reports, new features and questions are welcome! ๐Ÿ˜‰ If you have any question or concern, or you want to suggest a new feature, or you want just want to improve tui-realm, feel free to open an issue or a PR.

Please follow our contributing guidelines


Changelog โณ

View tui-realm's changelog HERE


License ๐Ÿ“ƒ

tui-realm is licensed under the MIT license.

You can read the entire license HERE

More Repositories

1

termscp

๐Ÿ–ฅ A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB
Rust
1,173
star
2

tuifeed

๐Ÿ“ฐ A terminal feed reader with a fancy ui
Rust
102
star
3

suppaftp

a super FTP/FTPS client library for Rust with support for both passive and active mode
Rust
90
star
4

termiWin

termiWin: a termios porting for Windows
C
59
star
5

pavao

A Rust client library for SMB ๐Ÿฆš
Rust
49
star
6

remotefs-rs

โซ A client library to work with all file transfer protocols โฌ
Rust
38
star
7

ATtila

Python module to communicate easily with modems and RF modules using AT commands
Python
25
star
8

tui-realm-stdlib

๐ŸŽจ Standard components library for tui-realm
Rust
24
star
9

tui-realm-treeview

๐ŸŒฒ treeview component for tui-realm ๐Ÿ‘‘
Rust
15
star
10

FlapQML

Flap QML Component
QML
12
star
11

instagram-scraper-rs

A rust library to scrape an instagram user's photos and videos
Rust
11
star
12

mannaggia-py

Mannaggia.sh for big brains
Python
9
star
13

remotefs-rs-ssh

RemoteFS SCP/SFTP clients
Rust
9
star
14

ssh2-config

a ssh config parser for ssh2-rs
Rust
8
star
15

remotefs-rs-smb

RemoteFS SMB client
Rust
7
star
16

buongiornissimo-rs

A Rust library to scrape for the best Italian boomer flavoured images
Rust
6
star
17

libBMpp

Windows Bitmap (BMP) library for modern C++
C++
5
star
18

brol

A repository with all those useful code snippets and tools written during my career as developer.
Rust
5
star
19

bitpanda730

๐Ÿ‡ฎ๐Ÿ‡น Ottieni le indicazioni su come compilare il 730 partendo dalle transazioni Bitpanda
Rust
4
star
20

tui-realm-textarea

tui-realm component for rhysd/tui-textarea
Rust
4
star
21

donmaze

An interactive adventure terminal game in a labyrinth
Rust
4
star
22

orange-trees

๐ŸŠ A Rust implementation of the Tree data structure ๐ŸŠ
Rust
4
star
23

StringEXT

C extension of string.h
C
4
star
24

opentapo-wearos

Tp-Link Tapo App for WearOS
Kotlin
3
star
25

pyc-shell

Use your alphabet with your favourite shell
Rust
3
star
26

librib

C library to implement IPv4/IPv6 routing tables
C
3
star
27

QMLog

Simple QML Logger component and library
C++
3
star
28

remotefs-rs-ftp

RemoteFS FTP client
Rust
2
star
29

WebTermJS

A simple web terminal implemented using NodeJS. (Or PHP)
JavaScript
2
star
30

popen-redirections

Just a simple C program which shows how to redirect stdout/stdin of child process to parent
C
2
star
31

big-luca-bot

Le perle e le news del papi su Telegram in ogni momento
Rust
2
star
32

homebrew-termscp

homebrew builder for termscp
Ruby
2
star
33

bigluca

Cryptopapies NFT generator
Rust
2
star
34

tuirealm_derive

Derive macro for Components
Rust
2
star
35

rust-wasm-app

A template repository to setup a Rust WASM Application
Rust
2
star
36

padrepio-bot

Discord/Telegram/Alexa bot to interact with Padre Pio via ChatGPT
Python
2
star
37

yubico-authenticator-wearos

Yubico Authenticator for WearOS
Kotlin
1
star
38

fe-react-template

my frontend ReactJS template
TypeScript
1
star
39

LangJS

Instant language manager for your Webpages
JavaScript
1
star
40

just-a-blockchain

Just a blockchain written in Rust without any real purpose
Rust
1
star
41

remotefs-rs-aws-s3

RemoteFS Aws S3 client
Rust
1
star
42

vxt

A python CLI tool to extract voice sentences from audio files with speech recognition
Python
1
star
43

shell-core

Rust library which provides core functionalities to implement shells
Rust
1
star
44

eth-fundfwd

A NodeJS Daemon to forward incoming funds on provided Ethereum address to an output address using Alchemy
TypeScript
1
star
45

react-ic-wallet

A simple Context provider and component in order to manage different IC wallets in the browser.
TypeScript
1
star
46

comuni-province-regioni

Typescript definition with attributes for Comuni (Cities), Province (Provinces) and Regioni (Regions) in Italy
TypeScript
1
star