Expand description
§ratatui-toolkit
A comprehensive collection of reusable TUI components for ratatui, the Rust terminal UI library.
§Overview
This crate provides production-ready, reusable widgets for building terminal user interfaces:
- Layout Components:
ResizableSplit,MasterLayoutfor flexible UI layouts - UI Components:
Button,Dialog,Toast,Panefor common UI elements - Widgets:
TreeView,ClickableScrollbar,FuzzyFinderfor data display - Navigation:
MenuBar,HotkeyFooter,StatusBarfor navigation aids - Rendering:
render_markdownfor markdown to ratatui text conversion - Terminal:
AlacTerm,VT100Termfor embedded terminal emulation
§Feature Flags
The crate uses feature flags to minimize dependencies:
| Feature | Default | Description |
|---|---|---|
markdown | Yes | Markdown rendering support |
tree | Yes | Tree view widget |
dialog | Yes | Modal dialog components |
toast | Yes | Toast notification system |
split | Yes | Resizable split panels |
menu | Yes | Menu bar component |
statusbar | Yes | Status bar components |
hotkey | Yes | Hotkey footer and modal |
terminal | No | Terminal emulators (AlacTerm, VT100) |
fuzzy | No | Fuzzy finder component |
master-layout | No | Full application layout framework |
file-tree | No | File system tree with devicons |
full | No | Enable all features |
§Quick Start
use ratatui::prelude::*;
use ratatui_toolkit::prelude::*;
// Create a resizable split
let split = ResizableSplit::new(30); // 30% left, 70% right
// Create a toast notification
let mut manager = ToastManager::new();
manager.success("File saved!");
// Render markdown
let text = render_markdown("# Hello\n\n**Bold** and *italic* text.", None);§Examples
See the examples/ directory for runnable demos of each component:
cargo run --example resizable_split_demo
cargo run --example tree_view_demo --features tree
cargo run --example toast_manager_demo --features toastRe-exports§
pub use button::Button;pub use clickable_scrollbar::ClickableScrollbar;pub use clickable_scrollbar::ClickableScrollbarState;pub use clickable_scrollbar::ScrollbarEvent;pub use pane::Pane;pub use dialog::Dialog;dialogpub use dialog::DialogType;dialogpub use dialog::DialogWidget;dialogpub use toast::render_toasts;toastpub use toast::Toast;toastpub use toast::ToastLevel;toastpub use toast::ToastManager;toastpub use resizable_split::ResizableSplit;splitpub use resizable_split::SplitDirection;splitpub use tree_view::get_visible_paths;treepub use tree_view::NodeState;treepub use tree_view::TreeKeyBindings;treepub use tree_view::TreeNode;treepub use tree_view::TreeView;treepub use tree_view::TreeViewState;treepub use menu_bar::MenuBar;menupub use menu_bar::MenuItem;menupub use statusbar::StatusBar;statusbarpub use statusbar::StatusItem;statusbarpub use statusline_stacked::OperationalMode;statusbarpub use statusline_stacked::StatusLineStacked;statusbarpub use statusline_stacked::StyledStatusLine;statusbarpub use statusline_stacked::SLANT_BL_TR;statusbarpub use statusline_stacked::SLANT_TL_BR;statusbarpub use hotkey_footer::HotkeyItem;hotkeypub use hotkey_modal::render_hotkey_modal;hotkeypub use hotkey_modal::Hotkey;hotkeypub use hotkey_modal::HotkeyModalConfig;hotkeypub use hotkey_modal::HotkeySection;hotkeypub use markdown_renderer::render_markdown;markdownpub use markdown_renderer::render_markdown_with_style;markdownpub use markdown_renderer::MarkdownStyle;markdownpub use alac_term::AlacTerm;terminalpub use vt100_term::VT100Term;terminalpub use ai_chat::AiChat;terminalpub use fuzzy_finder::FuzzyFinder;fuzzypub use file_system_tree::FileSystemEntry;file-treepub use file_system_tree::FileSystemTree;file-treepub use file_system_tree::FileSystemTreeConfig;file-treepub use master_layout::EventResult;master-layoutpub use master_layout::InteractionMode;master-layoutpub use master_layout::MasterLayout;master-layoutpub use master_layout::PaneContent;master-layoutpub use master_layout::PaneId;master-layoutpub use master_layout::PaneLayout;master-layoutpub use master_layout::Tab;master-layoutpub use master_layout::TabButton;master-layout
Modules§
- ai_chat
terminal - alac_
term terminal - button
- clickable_
scrollbar - Clickable scrollbar with mouse support adapted from rat-salsa’s rat-scrolled
- dialog
dialog - file_
system_ tree file-tree - fuzzy_
finder fuzzy - hotkey_
footer hotkey - hotkey_
modal hotkey - markdown_
renderer markdown - master_
layout master-layout - Master Layout Framework
- menu_
bar menu - pane
- prelude
- Prelude module for convenient imports
- resizable_
split split - statusbar
statusbar - statusline_
stacked statusbar - A status-line widget that can stack up indicators on the left and right end.
- toast
toast - tree_
view tree - vt100_
term terminal - VT100 Terminal implementation inspired by mprocs
Enums§
- Error
- Error types for the crate
Type Aliases§
- Result
- Result type for the crate