Skip to content

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:

ratatui-kit = { path = "crates/ratatui-kit", features = ["full"] }

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.

ratatui-kit has an empty default feature set:

[features]
default = []

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:

featureEnablesExtra dependencies
routerRouterProvider, Outlet, routes!, use_navigate, use_params, RouteStateregex
atomAtom, AtomState, use_atomnone
inputInput, SearchInput, and the tui_input re-exporttui-input
treeTreeSelect and the tui_tree_widget re-exporttui-tree-widget
virtual-listVirtualList and the tui_widget_list re-exporttui-widget-list
textareaTextArea, soft wrapping and mouse seekingtui-input, unicode-width
tableTables with width-aware wrappingunicode-width
serdePalette serializationserde, ratatui/serde
fullAll features aboveAll 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"] }
What you want to buildRecommendation
Basic UI, counters, local state, and ordinary layoutNo feature flags
Input / SearchInputEnable input
Tree selectionEnable tree
Virtual lists or virtual multi-select patternsEnable virtual-list
Multi-page terminal applicationsEnable router
Cross-page shared business stateEnable atom
Following the full docsEnable 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.

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:

cargo test --locked --all-features --workspace --lib --tests --examples
cargo clippy --all-targets --all-features --workspace -- -D warnings
cargo fmt --all --check

This also matters for documentation maintenance: if a page covers TreeSelect, VirtualList, or Router, verification should compile the corresponding feature.

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.