Installation and feature flags
Ratatui Kit is a Rust crate. A minimal application needs two kinds of dependencies: ratatui-kit itself and an async runtime. The docs and examples use Tokio.
# Cargo.toml
[dependencies]
ratatui-kit = { version = "0.12.0" }
tokio = { version = "1", features = [
"rt-multi-thread", "macros", "time",
] }
If you are developing examples inside this repository, they use a workspace path dependency:
Use full while learning
Section titled “Use full while learning”All repository examples enable full because they cover routing, Atom, input, tree selection, and virtual lists:
ratatui-kit = { version = "0.12.0", features = ["full"] }
full is a good fit when you are:
- Running every example while following the docs.
- Prototyping and do not want to decide feature boundaries yet.
- Writing an internal tool where binary size and dependency count are not the first priority.
Once you start building a library, template, or application that needs tighter dependency control, enable smaller feature sets as needed.
Default features are empty
Section titled “Default features are empty”ratatui-kit has an empty default feature set:
That means a bare dependency includes only the core runtime, component model, hooks, layout, text, scrolling, and foundational components. Advanced capabilities are enabled by feature flag:
| feature | Enables | Extra dependencies |
|---|---|---|
router | RouterProvider, Outlet, routes!, use_navigate, use_params, RouteState | regex |
atom | Atom, AtomState, use_atom | none |
input | Input, SearchInput, and the tui_input re-export | tui-input |
tree | TreeSelect and the tui_tree_widget re-export | tui-tree-widget |
virtual-list | VirtualList and the tui_widget_list re-export | tui-widget-list |
textarea | TextArea, soft wrapping and mouse seeking | tui-input, unicode-width |
table | Tables with width-aware wrapping | unicode-width |
serde | Palette serialization | serde, ratatui/serde |
full | All features above | All dependencies above |
Examples:
# Search input and confirmation modals only
ratatui-kit = { version = "0.12.0", features = ["input"] }
# Multi-page app + global business state
ratatui-kit = { version = "0.12.0", features = ["router", "atom"] }
# Large data lists
ratatui-kit = { version = "0.12.0", features = ["virtual-list"] }
Choosing features
Section titled “Choosing features”| What you want to build | Recommendation |
|---|---|
| Basic UI, counters, local state, and ordinary layout | No feature flags |
Input / SearchInput | Enable input |
| Tree selection | Enable tree |
| Virtual lists or virtual multi-select patterns | Enable virtual-list |
| Multi-page terminal applications | Enable router |
| Cross-page shared business state | Enable atom |
| Following the full docs | Enable full |
Modal components themselves do not need the input feature. Modal, ConfirmModal, AlertModal, and ShortcutInfoModal get input isolation from the framework’s core event layer; the input feature only controls the text-input components built on tui-input.
Validate with all-features
Section titled “Validate with all-features”Because the default feature set is empty, a plain cargo check can miss gated modules when you change framework source or examples. Repository validation commands must use --all-features:
This also matters for documentation maintenance: if a page covers TreeSelect, VirtualList, or Router, verification should compile the corresponding feature.
Multi-line editing
Section titled “Multi-line editing”Enable textarea for TextArea, including soft wrapping, keyboard editing and mouse cursor seeking. It uses tui-input and the framework’s own display layer on Ratatui 0.30, and is included in full. Run cargo run --example textarea. For read-only multi-line display use WrappedText.
Next, go to Quick start and run your first terminal interface.