Installation
[dependencies]
tui-pages = "0.7.0"
crossterm = "0.28"
Why these two extra crates:
crossterm—tui-pagesdoesn't read the keyboard for you. In your event loop you read a key with crossterm and pass it totui.handle_key(key, …), whose parameter is acrossterm::event::KeyEvent. So crossterm has to be your own dependency — that's the type the two of you exchange. No conversion needed.- a renderer — the core crate ships no drawing code and doesn't depend on
ratatui; you draw the screen.ratatuiis the obvious pick (and all the examples use it), but nothing forces it. Only the optionaldialogfeature pullsratatuiin.
Features
dialog
A built-in modal dialog with a ratatui renderer. Pulls in ratatui 0.28.
tui-pages = { version = "0.7", features = ["dialog"] }
Gives you DialogData, DialogResult, DialogTheme, render_dialog, and the
dialog::* helpers that drive a modal for you. See Dialogs.
serde
Derives Serialize/Deserialize on the input/mode types (ModeId, KeyChord,
FocusWrap), so you can load keybindings from a config file.
tui-pages = { version = "0.7", features = ["serde"] }
Edition
The crate is built on Rust edition 2021.