Git Product home page Git Product logo

tundra's Introduction

๐Ÿ”๏ธ Tundra

Tundra provides a framework and utilities for creating interactive terminal applications with Ratatui.

Ratatui is a comprehensive library for creating singular user interfaces in the terminal, but lacks features for organizing larger applications โ€” composed of several interfaces โ€” and for receiving user data input.

Tundra aims to extend the functionality of Ratatui with utilities for:

  • Defining application states.
  • Managing the terminal environment and context.
  • Displaying messages through modal dialogs.
  • Receiving user input through input forms and fields.

Tundra is also highly extensible with tools to easily define your own dialogs and input fields.

It is not intended to be a replacement for or wrapper over Ratatui, nor the backend. Ratatui is still required to draw the user interface of each application state, and the backend is still required for low-level terminal operations.

๐Ÿ“š Documentation

Read the documentation HERE.

๐Ÿชช Modal Dialogs

Modal dialogs are small pop-up "windows" displayed atop a background application state. They contain messages or prompt for user input and are shown simply by calling a function. Here is an example of an error message shown in a dialog:

dialog error demo

Tundra defines several more such dialogs with easy-to-use interfaces, and provides utilities for creating custom dialogs.

๐Ÿ•น๏ธ User Input

User input is facilitated through a macro that displays a form with specified fields inside a dialog. The return value of the macro invocation is a struct containing the values entered by the user for each field. Both the values and the fields are stored as members of unspellable structs created inside the macro โ€” no runtime lookup is required! Here is an example of such a form:

dialog form demo

Tundra defines several types of fields for entering common types of data, and provides utilities for creating custom fields.

๐Ÿชง A Note on the Backend

Ratatui has support for several terminal backends. If you don't know what that means, this note holds no significance for you.

Tundra currently only supports the crossterm backend. This is due to a lack of abstraction over the different backends. Code โ€” particularly pertaining to context and event handling โ€” would have to be written and repeated for each backend.

If you need another backend for your project, Tundra is not for you โ€” at least for the moment.

tundra's People

Contributors

user-simon avatar

Watchers

 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.