https://github.com/jwodder/ratselect
TUI selection list forms in Rust with Ratatui
https://github.com/jwodder/ratselect
forms ratatui rust terminal tui
Last synced: about 1 month ago
JSON representation
TUI selection list forms in Rust with Ratatui
- Host: GitHub
- URL: https://github.com/jwodder/ratselect
- Owner: jwodder
- License: mit
- Created: 2026-04-26T20:06:50.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-06-08T16:01:10.000Z (about 2 months ago)
- Last Synced: 2026-06-08T17:11:33.313Z (about 2 months ago)
- Topics: forms, ratatui, rust, terminal, tui
- Language: Rust
- Homepage:
- Size: 155 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.repostatus.org/#concept)
[](https://github.com/jwodder/ratselect/actions/workflows/test.yml)
[](https://codecov.io/gh/jwodder/ratselect)
[](https://www.rust-lang.org)
[](https://opensource.org/licenses/MIT)
[](https://ratatui.rs/)
[GitHub](https://github.com/jwodder/ratselect) | [Issues](https://github.com/jwodder/ratselect/issues)
This is an experimental Rust library made using [Ratatui](https://ratatui.rs)
for presenting a user with a full-screen terminal interface consisting of a
series of *selection lists* (radio buttons and sets of checkboxes) and
capturing their choices.

Usage, in brief:
- Create a new `Form`
- Call `form.add(list_key, selector)` with each `RadioSelector` or
`MultiSelector` you wish to present to the user
- Call `form.run()` to run the interface and get the user's selections. If the
user cancelled/quit the interface, this method returns `None`; otherwise, it
returns `Some(selections)`, where `selections` is a `Vec<(T, Selection)>`
pairing the `list_key`'s supplied to `add()` with the choices the user made
for the respective selection lists.
The terminal interface supports the following keybindings:
| Key | Command |
| ------------------------------------------ | -------------------------------------------------------------------------- |
| j, Down | Move down one item |
| k, Up | Move up one item |
| h, Left | Move left one item |
| l, Right | Move right one item |
| g, Home | Go to first item |
| G, End | Go to start of last line (i.e., the "OK" button) |
| Tab | Go to start of next selection list or next button, wrapping around |
| Shift+Tab | Go to start of previous selection list or previous button, wrapping around |
| Enter, Space | Select/toggle/activate current selection |
| q, Q, Esc | Cancel & quit |
See Also
========
- [`curselect`](https://github.com/jwodder/curselect), a roughly-equivalent
implementation in Python made using the [urwid](https://urwid.org) library
- [`cursive-select`](https://github.com/jwodder/cursive-select), a
roughly-equivalent implementation in Rust made using the
[`cursive`](https://crates.io/crates/cursive) library