- Uses tokio for async events
- Start and stop key events to shell out to another TUI like vim
- Supports suspend signal hooks
- Logs using tracing
- Clap for command line argument parsing
Fpscomponents as examples
You can start by using
You can also use a
file to skip the prompts:
Without direnv variables:
With direnv variables:
Read documentation on design decisions in the template here: https://ratatui.rs/templates/component/
The source code of this project is
an opinionated template for getting up and running with
ratatui. You can pick and choose the
pieces of this template to suit your needs and sensibilities. This rest of this documentation is a
walk-through of why the code is structured the way it is, so that you are aided in modifying it as
ratatui is based on the principle of immediate rendering with intermediate buffers. This means
that at each new frame you have to build all widgets that are supposed to be part of the UI. In
ratatui library is largely handles just drawing to the terminal.
Additionally, the library does not provide any input handling nor any event system. The responsibility of getting keyboard input events, modifying the state of your application based on those events and figuring out which widgets best reflect the view of the state of your application is on you.
ratatui-org project has added a template that covers the basics, and you find that here:
I wanted to take another stab at a template, one that uses
tokio and organizes the code a little
differently. This is an opinionated view on how to organize a
This project also adds commonly used dependencies like logging, command line arguments, configuration options, etc.
As part of this documentation, we’ll walk through some of the different ways you may choose to organize your code and project in order to build a functioning terminal user interface. You can pick and choose the parts you like.
You may also want to check out the following links (roughly in order of increasing complexity):
- https://github.com/ratatui-org/ratatui/tree/main/examples: Simple one-off examples to illustrate
various widgets and features in
- https://github.com/ratatui-org/templates/tree/main/simple: Starter kit for using
- https://github.com/ratatui-org/templates/tree/main/async: Starter kit for using
- https://github.com/ratatui-org/website/tree/main/code/ratatui-json-editor-app: Tutorial project that the user a simple interface to enter key-value pairs, which will printed in json.
- https://github.com/ratatui-org/templates/tree/main/component: Async tokio crossterm based
opinionated starter kit with “components” for using
- https://github.com/veeso/tui-realm/: A framework for
tui.rsto simplify the implementation of terminal user interfaces adding the possibility to work with re-usable components with properties and states.