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.10.2" }
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.10.2", 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 |
full | All features above | All dependencies above |
Examples:
# Search input and confirmation modals only
ratatui-kit = { version = "0.10.2", features = ["input"] }
# Multi-page app + global business state
ratatui-kit = { version = "0.10.2", features = ["router", "atom"] }
# Large data lists
ratatui-kit = { version = "0.10.2", 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.
textarea is temporarily unavailable
Section titled “textarea is temporarily unavailable”The textarea feature is not currently wired in. The underlying tui-textarea version does not yet support the current Ratatui 0.30 stack. The source remains in the repository, but it is not declared as a module and is not included in full.
For multi-line body display, prefer WrappedText. For editable single-line input, use Input or SearchInput.
Next, go to Quick start and run your first terminal interface.