Expand description
tui-lipan: opinionated, component-based, modern TUI framework.
This crate is built on top of ratatui + crossterm internally, but the
public API is backend-agnostic (no ratatui types leak).
Re-exports§
pub use crate::capture::CapturedCell;pub use crate::capture::CapturedFrame;pub use crate::capture::CellModifiers;pub use crate::capture::CursorState;pub use crate::capture::PngOptions;pub use crate::capture::PngTextRenderer;pub use crate::core::component::Breakpoint;pub use crate::core::component::Command;pub use crate::core::component::Component;pub use crate::core::component::Context;pub use crate::core::component::KeyUpdate;pub use crate::core::component::ScrollbarVisibility;pub use crate::core::component::TaskPolicy;pub use crate::core::component::Update;pub use crate::core::context_value::ContextValue;pub use crate::core::element::Element;pub use crate::core::element::IntoElement;pub use crate::core::element::Key;pub use crate::core::event::KeyCode;pub use crate::core::event::KeyEvent;pub use crate::core::event::KeyMods;pub use crate::core::event::MouseDragEvent;pub use crate::core::event::MouseEvent;pub use crate::core::event::MouseMoveEvent;pub use crate::core::mask::CellMask;pub use crate::core::memo::Memo;pub use crate::core::node::NodeId;pub use crate::input::ChordMatcher;pub use crate::input::ChordResult;pub use crate::input::KeyBinding;pub use crate::input::KeyBindingParseError;pub use crate::input::KeyBindings;pub use crate::input::format_binding;pub use crate::input::format_binding_lowercase;pub use crate::input::format_bindings;pub use crate::input::format_bindings_lowercase;pub use crate::process::ProcessEvent;pub use crate::process::ProcessExitStatus;pub use crate::process::ProcessSpec;pub use crate::process::process_command;pub use crate::process::process_command_keyed;pub use crate::process::stream_process;pub use crate::process::stream_process_until;pub use crate::style::Theme;pub use crate::style::Align;pub use crate::style::BorderEdges;pub use crate::style::BorderStyle;pub use crate::style::CaretShape;pub use crate::style::CellEffect;pub use crate::style::Color;pub use crate::style::ColorTransform;pub use crate::style::DiffPalette;pub use crate::style::DocumentPalette;pub use crate::style::DocumentViewPalette;pub use crate::style::Edge;pub use crate::style::EffectAxis;pub use crate::style::EffectContext;pub use crate::style::EffectPalette;pub use crate::style::EffectPrepareContext;pub use crate::style::FileIconPalette;pub use crate::style::FloatRect;pub use crate::style::GitStatusPalette;pub use crate::style::HexAreaPalette;pub use crate::style::HostTerminalColors;pub use crate::style::InputPalette;pub use crate::style::Justify;pub use crate::style::LayoutConstraints;pub use crate::style::Length;pub use crate::style::Padding;pub use crate::style::Paint;pub use crate::style::PreparedCellEffect;pub use crate::style::Rect;pub use crate::style::RetroPreset;pub use crate::style::RichText;pub use crate::style::RippleRadius;pub use crate::style::ScrollbarConfig;pub use crate::style::ScrollbarPalette;pub use crate::style::ScrollbarVariant;pub use crate::style::ShrinkPriority;pub use crate::style::Size;pub use crate::style::Span;pub use crate::style::StatusPalette;pub use crate::style::Style;pub use crate::style::SurfacePalette;pub use crate::style::SyntaxPalette;pub use crate::style::TerminalPalette;pub use crate::style::TextAreaPalette;pub use crate::style::ThemeExtension;pub use crate::style::ThemePalette;pub use crate::style::VisualEffect;pub use crate::style::query_host_colors;pub use crate::style::ThemeWatcher;pub use crate::style::load_theme_from_toml;pub use crate::ui_snapshot::UiSnapshot;pub use crate::ui_snapshot::UiSnapshotFileFormat;pub use crate::ui_snapshot::UiSnapshotFormatOptions;pub use crate::ui_snapshot::UiSnapshotOptions;pub use crate::ui_snapshot::UiSnapshotSlot;pub use crate::ui_snapshot::UiWidgetDesc;pub use crate::ui_snapshot::UiWidgetKind;pub use crate::validation::StringValidator;pub use crate::validation::ValidationError;pub use crate::validation::Validator;
Modules§
- animation
- Animation primitives.
- callbacks
- Ready-made
Callbackvalues for common side effects, such as opening URLs without aMsgroute. - capture
- Public frame-capture types for snapshot and visual tests.
- core
- Core framework definitions.
- debug
- Debug and diagnostic utilities.
- input
- Public keybinding parsing, matching, and formatting utilities.
- prelude
- This prelude is intentionally curated for app authors.
- process
- Native-only helpers for streaming child-process output into components.
- style
- Styling and layout primitives for the TUI framework.
- terminal_
handoff - Temporarily release the interactive terminal for an external program (e.g.
$EDITOR). - ui_
snapshot - Agent-oriented UI snapshots combining rendered frames and semantic widget metadata.
- utils
- Utility functions.
- validation
- Composable validation for form fields.
Macros§
- debug_
log - Debug logging macro (enabled by TUI_LIPAN_DEBUG=1).
- mockup
- One-liner macro for previewing a TUI layout without any component boilerplate.
- rsx
- Macro for building
Elements with struct-literal syntax. - ui
- Autocomplete-friendly macro for building
Elements with builder chains.
Structs§
- App
- Application builder.
- AppRunner
- A mounted and runnable app.
- Callback
- A cheap-to-clone event handler.
- Cancellation
Token - Cooperative cancellation state for a background command.
- Canvas
- Absolute-positioned child container.
- Canvas
Item - A single child placed at a Canvas-local rectangle.
- Class
Diagram - A static UML class diagram laid out automatically from classes and relations.
Build it with the chaining setters and convert into an
Element. - Class
Diagram Theme - Visibility-prefix glyphs used to render
ClassMembers in aClassDiagram. - Class
Member - A single attribute or method of a
ClassSpec. - Class
Relation - A relationship between two classes, with kind, multiplicities, and label.
- Class
Spec - A class box with its attributes and methods.
- Clipboard
Config - Clipboard configuration for the runtime.
- Command
Builder - Builder for
CommandEntry. - Command
Entry - One command entry in the runtime registry.
- Command
Id - Stable identifier for a registered command.
- Command
Link - Type-safe handle used by background tasks to send messages back to the UI thread.
- Command
Registry - Shared runtime command registry.
- Context
Provider - Provide a typed context value for a subtree.
- DevTools
Config - Runtime devtools subsystem configuration.
- Diagram
Class Member Spec - Class member.
- Diagram
Class Node Spec - Class definition.
- Diagram
Class Relation Spec - Class relation kind.
- Diagram
Class Spec - Class diagram spec.
- Diagram
ErAttribute Spec - ER attribute.
- Diagram
ErEntity Spec - ER entity.
- Diagram
ErRelation Spec - ER relation.
- Diagram
ErSpec - ER diagram spec.
- Diagram
Flow Edge Spec - Flowchart edge.
- Diagram
Flow Node Spec - Flowchart node.
- Diagram
Flowchart Spec - Flowchart diagram spec.
- Diagram
Gantt Date - Diagram
Gantt Duration - Diagram
Gantt Section - Diagram
Gantt Spec - Diagram
Gantt Task - Diagram
PieSlice Spec - Pie slice.
- Diagram
PieSpec - Pie chart spec.
- Diagram
Sequence Message Spec - Sequence message.
- Diagram
Sequence Participant Spec - Sequence participant.
- Diagram
Sequence Spec - Sequence diagram spec.
- Diagram
State Node Spec - State node.
- Diagram
State Spec - State diagram spec.
- Diagram
State Transition Spec - State transition.
- Diff
Context Expansion - Controlled expansion state for one collapsed context range.
- Diff
Context Range - Stable identifier for a collapsed unchanged range in a
DiffView. - Diff
Context Separator Event - Event emitted when a collapsed context separator is clicked.
- Diff
Data - Precomputed diff data for reuse across renders.
- Diff
Data Config - Diff data configuration used for precomputing a diff.
- Diff
Hunk Anchor - Logical row anchor for one parsed patch hunk in a
DiffView. - Effect
Cell - Terminal cell type passed to
CellEffect::apply. A buffer cell - ErAttribute
- A single column of an
ErEntity. - ErDiagram
- A static entity-relationship diagram laid out automatically from entities and
relations. Build it with the chaining setters and convert into an
Element. - ErDiagram
Theme - Badge labels shown next to key attributes in an
ErDiagram. - ErEntity
- A table/entity in an
ErDiagram, with a name and ordered attributes. - ErRelation
- A relationship between two entities, with crow’s-foot cardinality on each end.
- File
Tree - Lazy-loading file explorer tree.
- File
Tree Change - App/server-provided file change entry.
- File
Tree Event - File selection event emitted by
FileTree. - File
Tree Item Style - Optional style decorations for an exact
FileTreepath. - File
Tree Toggle Event - File expand/collapse event emitted by
FileTree. - Formatted
Diagram Block - A parsed diagram block with its original source text retained for copy/selection.
- Gantt
Date - Gantt
Diagram - Gantt
Diagram Theme - Gantt
Duration - Gantt
Section - Gantt
Spec - Gantt
Task - Heatmap
- A heatmap widget that visualizes a 2D matrix of values as colored cells.
- HexArea
- Hex/ASCII binary data viewer.
- HexArea
Change Event - Change event emitted by
HexArea. - HexArea
Cursor Event - Cursor movement event emitted by
HexArea. - HexArea
Edit Event - Edit event emitted by
HexArea. - Image
Content - Image content read from or written to the clipboard.
- KeyHandler
- A cheap-to-clone key handler that reports handled status.
- Line
Index - Snapshot index of logical line starts for a UTF-8 text buffer.
- Link
- Type-safe handle used to send messages to a specific component instance.
- Mockup
- A view-only component wrapper for rapid UI prototyping.
- Mouse
Mode State - Combined mouse mode state.
- Overlay
Id - Unique identifier for an overlay entry.
- PanEvent
- Event emitted after a
PanViewoffset changes. - PanKeymap
- Key bindings for
PanViewkeyboard panning. - PanMetrics
- Pan viewport metrics for a single axis pair.
- PanView
- A single-child two-dimensional panning viewport.
- Scroll
Distance Config - Distance-based timing for smooth programmatic scroll targets.
- Scroll
Event - A scroll event.
- Scroll
Exited Child - Previously visible child that exited the viewport.
- Scroll
Metrics - Scroll viewport metrics.
- Scroll
Viewport Event - Viewport-change event for visible immediate
ScrollViewchildren. - Scroll
Visible Child - Snapshot of one immediate
ScrollViewchild visible in the effective viewport. - Scroll
Wheel Config - Physics parameters for opt-in smooth wheel scrolling.
- Sentinel
Id - Opaque stable identifier for a sentinel, unique within a TextArea lifetime.
- State
Diagram - A static UML state diagram laid out automatically from states and transitions.
Build it with the chaining setters and convert into an
Element. - State
Diagram Theme - Glyphs used to render pseudo-states in a
StateDiagram. - State
Spec - A single state node in a
StateDiagram. - State
Transition - A directed transition between two states, with an optional label and guard.
- Syntect
Document Formatter - Wraps a
SyntectStrategyas aContentFormatterforDocumentView. - Syntect
Strategy - Syntax highlighting strategy powered by syntect.
- Terminal
Color Palette - Color palette used to resolve terminal ANSI/default colors into concrete UI colors.
- Terminal
Render Snapshot - Renderable terminal snapshot from
TerminalScreen. - Test
Backend - Headless runtime for unit-testing components.
- Text
Area - A multi-line text input.
- Text
Area Color Input - Input data for text coloring strategies.
- Text
Area Cursor Metrics - Cursor cell metrics for a
TextAreaMetricssnapshot. - Text
Area Decoration - Public style decoration for byte ranges in a
TextArea. - Text
Area Event - A text area change event.
- Text
Area Gutter - Composable TextArea gutter configuration.
- Text
Area Gutter Column - One composable gutter column.
- Text
Area Gutter Sign - A sign/adornment rendered in a composable TextArea gutter column.
- Text
Area Metrics - Previous-frame resolved layout and cursor metrics for a keyed
TextArea. - Text
Area Paste Event - A text paste event emitted before default text insertion.
- Text
Area Sentinel - A user-defined inline sentinel token embedded in
TextAreatext. - Text
Area Sentinel Click Event - Event emitted when the user clicks an inline sentinel placeholder.
- Text
Area Snapshot - In-memory snapshot of text value, cursor, sentinels, and inline images.
- Text
Area State Change Event - Reason-tagged editor state transition emitted by
TextArea::on_editor_state_change. - Text
Area VimConfig - Rendering configuration for TextArea Vim affordances.
- Text
Area VimKey Binding - One TextArea Vim key remap entry.
- Text
Area VimKeymap - Widget-local Vim key remaps for
TextArea::vim_motions. - Text
Area Virtual Text - Non-editable styled text rendered by a
TextAreawithout entering its value. - Text
Edit Event - A text edit description for external consumers (e.g. LSP clients).
- Text
Editor - A multi-line text editor with selection support.
- Text
Position - Zero-based text position in a logical line.
- Text
Range - Half-open text range expressed as line/column positions.
- Toast
- A transient notification message.
- Toast
Handle - Handle for showing toast notifications via
ctx.toast().
Enums§
- Class
Relation Kind - The kind of a
ClassRelation, controlling the edge/arrowhead style. - Class
Visibility - UML visibility of a
ClassMember, rendered as a+ - # ~prefix. - Clipboard
Error - Clipboard error emitted by providers.
- Contrast
Policy - Controls automatic foreground contrast adjustments for widget text.
- Diagram
Class Visibility Spec - UML visibility.
- Diagram
Direction - Flowchart orientation.
- Diagram
Flow Node Shape - Flowchart node shape subset.
- Diagram
Gantt Task Start - Diagram
Gantt Task Status - Diagram
State Kind Spec - State kind.
- Diff
Context Separator Direction - Direction of a collapsed context separator in a
DiffView. - Draggable
TabBar Overflow - Overflow behavior for a
DraggableTabBar. - ErCardinality
- Cardinality of one side of an
ErRelation, rendered as crow’s-foot notation. - Error
- Crate-wide error type.
- File
Kind - Filesystem entry kind used by
FileTreeevents. - File
Tree Change Source - Source used for file change decorations and changed-only projection.
- File
Tree Change Status - Status for a source-agnostic changed file.
- File
Tree Change View - Source-agnostic file tree change display mode.
- File
Tree Suffix Priority - Truncation priority for right-aligned FileTree change metadata.
- Gantt
Task Start - Gantt
Task Status - Heatmap
Cell Mode - Rendering strategy for heatmap cells.
- Heatmap
Legend Width - Horizontal layout mode for the heatmap legend.
- HexArea
Edit Kind - Edit kind emitted by
HexArea. - Image
Format - Supported image formats for clipboard operations.
- Inline
Startup Policy - Startup behavior for transcript inline mode.
- Mouse
Encoding - Mouse protocol encoding.
- Mouse
Mode - Mouse reporting mode requested by PTY application.
- Overlay
Scope - Controls whether overlay-like widget content renders at the root or inline.
- Parsed
Diagram - Parsed Mermaid diagram data supported by
DocumentView. - Paste
Shift Insert Behavior - Determines what Shift+Insert should paste.
- Screen
Background - How the root viewport background is painted before the UI tree renders.
- Scroll
Axis - Scroll axes enabled on a scroll container.
- Scroll
Behavior - How programmatic scroll targets are applied.
- Scroll
Child Exit Direction - Direction in which a previously visible child exited the viewport.
- Scroll
Child Visibility - Visibility classification for a child in a
ScrollViewviewport. - Scroll
Target - Semantic target for framework-owned
ScrollViewnavigation. - Scroll
Wheel Behavior - How user wheel input is applied.
- Sentinel
Event - Lifecycle event emitted when sentinels change.
- State
Kind - The kind of node a
StateSpecrepresents, controlling how it is rendered. - Surface
Mode - Public surface mode taxonomy for app rendering.
- Terminal
Color - Terminal color type used by custom visual effects. ANSI Color
- Text
Area Decoration Kind - Decoration rendering mode for
TextAreaDecoration. - Text
Area Image Mode - Whether images are embedded inline in the text value (sentinel chars) or displayed as attachment chips above the text input area.
- Text
Area Line Number Mode - Line-number display mode for the built-in
TextAreagutter. - Text
Area Newline Binding - Controls which Enter key combinations insert new lines in
TextArea. - Text
Area Sentinel Click Kind - A clicked inline sentinel inside a
TextArea. - Text
Area State Change Reason - Text
Area VimCurrent Line Highlight - Current-line highlighting mode for
TextArea::vim_config. - Text
Area VimMode - TextArea-only Vim-style modal motion mode.
- Text
Edit Kind - The kind of text edit that occurred.
- Text
Encoding - Column encoding used when projecting byte offsets to text positions.
- Toast
Copy Affordance - Visual affordance used for copyable toasts.
- Toast
Placement - Toast positioning on screen.
- Triple
Click Selection Mode - Behavior used for triple-click text selection.
- Virtual
Text Placement - Placement for
TextAreaVirtualText.
Constants§
- DEFAULT_
PREVIEW_ MAX_ HEIGHT - Default maximum height (cells) for a
DragPreview::SourceSnapshotfloat preview. - DEFAULT_
PREVIEW_ MAX_ WIDTH - Default maximum width (cells) for a
DragPreview::SourceSnapshotfloat preview. - IMAGE_
SENTINEL_ BASE - First Unicode Private Use Area character used as an inline image sentinel.
Each image at index
iin theimageslist is represented bychar::from_u32(IMAGE_SENTINEL_BASE as u32 + i as u32).unwrap()in the value string. - SENTINEL_
BASE - Base codepoint for custom (non-image) inline sentinels.
Traits§
- Clipboard
Provider - Abstraction over clipboard backends.
- Text
Area Color Strategy - Strategy for applying per-line styling to text content.
- Themable
Props - Trait for component properties that can be themed.
Functions§
- apply_
syntect_ strategy_ app_ theme - Applies a
Themeto aSyntectStrategyheld in anRc, matchingThemeProvidersharing semantics: uniqueRcs are mutated in place; sharedRcs are cloned and replaced. - child
- Create a nested component element.
- insert_
sentinel - Insert a custom sentinel into
valueatcursor, appending it tosentinels. - language_
from_ path - Resolve a language name from a file path using default syntect syntax definitions.
- rank_
search_ palette_ indices - Returns indices into
itemsinSearchPalettefuzzy-match order (best match first). - rank_
search_ palette_ indices_ with_ score - Returns indices into
itemsinSearchPalettefuzzy-match order after score adjustment.
Type Aliases§
- File
Tree GitView - Compatibility alias for the previous Git-specific display mode name.
- Result
- Crate-wide result type.
- Text
Area Color Lines - Per-line styled spans. Each entry corresponds to a logical line.