GithubHelp home page GithubHelp logo

doytsujin / tui-realm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from veeso/tui-realm

0.0 2.0 0.0 5.73 MB

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

License: MIT License

Rust 100.00%

tui-realm's Introduction

tui-realm

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

Get started ยท Standard Library ยท Documentation

Developed by @veeso

Current version: 1.8.0 (14/08/2022)

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

Crossterm CI Crossterm CI (Windows) Termion CI Coveralls Docs



About tui-realm ๐Ÿ‘‘

tui-realm is a framework for tui 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.8.0"

otherwise you can specify the features you want to add:

tuirealm = { version = "^1.8.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.
  • with-crossterm (default): use crossterm as backend for tui.
  • with-termion: use termion as backend for tui.

โš ๏ธ 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 โš ๏ธ

When you want to switch to another backend (e.g. from crossterm to termion), remember that you MUST disable default features, in order to disable crossterm.

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

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

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 litecoin


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

tui-realm's People

Contributors

dcbishop avatar imgbotapp avatar lucapette avatar orhun avatar tramhao avatar veeso avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.