Skip to main content

Crate tui_lipan

Crate tui_lipan 

Source
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 Callback values for common side effects, such as opening URLs without a Msg route.
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.
CancellationToken
Cooperative cancellation state for a background command.
Canvas
Absolute-positioned child container.
CanvasItem
A single child placed at a Canvas-local rectangle.
ClassDiagram
A static UML class diagram laid out automatically from classes and relations. Build it with the chaining setters and convert into an Element.
ClassDiagramTheme
Visibility-prefix glyphs used to render ClassMembers in a ClassDiagram.
ClassMember
A single attribute or method of a ClassSpec.
ClassRelation
A relationship between two classes, with kind, multiplicities, and label.
ClassSpec
A class box with its attributes and methods.
ClipboardConfig
Clipboard configuration for the runtime.
CommandBuilder
Builder for CommandEntry.
CommandEntry
One command entry in the runtime registry.
CommandId
Stable identifier for a registered command.
CommandLink
Type-safe handle used by background tasks to send messages back to the UI thread.
CommandRegistry
Shared runtime command registry.
ContextProvider
Provide a typed context value for a subtree.
DevToolsConfig
Runtime devtools subsystem configuration.
DiagramClassMemberSpec
Class member.
DiagramClassNodeSpec
Class definition.
DiagramClassRelationSpec
Class relation kind.
DiagramClassSpec
Class diagram spec.
DiagramErAttributeSpec
ER attribute.
DiagramErEntitySpec
ER entity.
DiagramErRelationSpec
ER relation.
DiagramErSpec
ER diagram spec.
DiagramFlowEdgeSpec
Flowchart edge.
DiagramFlowNodeSpec
Flowchart node.
DiagramFlowchartSpec
Flowchart diagram spec.
DiagramGanttDate
DiagramGanttDuration
DiagramGanttSection
DiagramGanttSpec
DiagramGanttTask
DiagramPieSliceSpec
Pie slice.
DiagramPieSpec
Pie chart spec.
DiagramSequenceMessageSpec
Sequence message.
DiagramSequenceParticipantSpec
Sequence participant.
DiagramSequenceSpec
Sequence diagram spec.
DiagramStateNodeSpec
State node.
DiagramStateSpec
State diagram spec.
DiagramStateTransitionSpec
State transition.
DiffContextExpansion
Controlled expansion state for one collapsed context range.
DiffContextRange
Stable identifier for a collapsed unchanged range in a DiffView.
DiffContextSeparatorEvent
Event emitted when a collapsed context separator is clicked.
DiffData
Precomputed diff data for reuse across renders.
DiffDataConfig
Diff data configuration used for precomputing a diff.
DiffHunkAnchor
Logical row anchor for one parsed patch hunk in a DiffView.
EffectCell
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.
ErDiagramTheme
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.
FileTree
Lazy-loading file explorer tree.
FileTreeChange
App/server-provided file change entry.
FileTreeEvent
File selection event emitted by FileTree.
FileTreeItemStyle
Optional style decorations for an exact FileTree path.
FileTreeToggleEvent
File expand/collapse event emitted by FileTree.
FormattedDiagramBlock
A parsed diagram block with its original source text retained for copy/selection.
GanttDate
GanttDiagram
GanttDiagramTheme
GanttDuration
GanttSection
GanttSpec
GanttTask
Heatmap
A heatmap widget that visualizes a 2D matrix of values as colored cells.
HexArea
Hex/ASCII binary data viewer.
HexAreaChangeEvent
Change event emitted by HexArea.
HexAreaCursorEvent
Cursor movement event emitted by HexArea.
HexAreaEditEvent
Edit event emitted by HexArea.
ImageContent
Image content read from or written to the clipboard.
KeyHandler
A cheap-to-clone key handler that reports handled status.
LineIndex
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.
MouseModeState
Combined mouse mode state.
OverlayId
Unique identifier for an overlay entry.
PanEvent
Event emitted after a PanView offset changes.
PanKeymap
Key bindings for PanView keyboard panning.
PanMetrics
Pan viewport metrics for a single axis pair.
PanView
A single-child two-dimensional panning viewport.
ScrollDistanceConfig
Distance-based timing for smooth programmatic scroll targets.
ScrollEvent
A scroll event.
ScrollExitedChild
Previously visible child that exited the viewport.
ScrollMetrics
Scroll viewport metrics.
ScrollViewportEvent
Viewport-change event for visible immediate ScrollView children.
ScrollVisibleChild
Snapshot of one immediate ScrollView child visible in the effective viewport.
ScrollWheelConfig
Physics parameters for opt-in smooth wheel scrolling.
SentinelId
Opaque stable identifier for a sentinel, unique within a TextArea lifetime.
StateDiagram
A static UML state diagram laid out automatically from states and transitions. Build it with the chaining setters and convert into an Element.
StateDiagramTheme
Glyphs used to render pseudo-states in a StateDiagram.
StateSpec
A single state node in a StateDiagram.
StateTransition
A directed transition between two states, with an optional label and guard.
SyntectDocumentFormatter
Wraps a SyntectStrategy as a ContentFormatter for DocumentView.
SyntectStrategy
Syntax highlighting strategy powered by syntect.
TerminalColorPalette
Color palette used to resolve terminal ANSI/default colors into concrete UI colors.
TerminalRenderSnapshot
Renderable terminal snapshot from TerminalScreen.
TestBackend
Headless runtime for unit-testing components.
TextArea
A multi-line text input.
TextAreaColorInput
Input data for text coloring strategies.
TextAreaCursorMetrics
Cursor cell metrics for a TextAreaMetrics snapshot.
TextAreaDecoration
Public style decoration for byte ranges in a TextArea.
TextAreaEvent
A text area change event.
TextAreaGutter
Composable TextArea gutter configuration.
TextAreaGutterColumn
One composable gutter column.
TextAreaGutterSign
A sign/adornment rendered in a composable TextArea gutter column.
TextAreaMetrics
Previous-frame resolved layout and cursor metrics for a keyed TextArea.
TextAreaPasteEvent
A text paste event emitted before default text insertion.
TextAreaSentinel
A user-defined inline sentinel token embedded in TextArea text.
TextAreaSentinelClickEvent
Event emitted when the user clicks an inline sentinel placeholder.
TextAreaSnapshot
In-memory snapshot of text value, cursor, sentinels, and inline images.
TextAreaStateChangeEvent
Reason-tagged editor state transition emitted by TextArea::on_editor_state_change.
TextAreaVimConfig
Rendering configuration for TextArea Vim affordances.
TextAreaVimKeyBinding
One TextArea Vim key remap entry.
TextAreaVimKeymap
Widget-local Vim key remaps for TextArea::vim_motions.
TextAreaVirtualText
Non-editable styled text rendered by a TextArea without entering its value.
TextEditEvent
A text edit description for external consumers (e.g. LSP clients).
TextEditor
A multi-line text editor with selection support.
TextPosition
Zero-based text position in a logical line.
TextRange
Half-open text range expressed as line/column positions.
Toast
A transient notification message.
ToastHandle
Handle for showing toast notifications via ctx.toast().

Enums§

ClassRelationKind
The kind of a ClassRelation, controlling the edge/arrowhead style.
ClassVisibility
UML visibility of a ClassMember, rendered as a + - # ~ prefix.
ClipboardError
Clipboard error emitted by providers.
ContrastPolicy
Controls automatic foreground contrast adjustments for widget text.
DiagramClassVisibilitySpec
UML visibility.
DiagramDirection
Flowchart orientation.
DiagramFlowNodeShape
Flowchart node shape subset.
DiagramGanttTaskStart
DiagramGanttTaskStatus
DiagramStateKindSpec
State kind.
DiffContextSeparatorDirection
Direction of a collapsed context separator in a DiffView.
DraggableTabBarOverflow
Overflow behavior for a DraggableTabBar.
ErCardinality
Cardinality of one side of an ErRelation, rendered as crow’s-foot notation.
Error
Crate-wide error type.
FileKind
Filesystem entry kind used by FileTree events.
FileTreeChangeSource
Source used for file change decorations and changed-only projection.
FileTreeChangeStatus
Status for a source-agnostic changed file.
FileTreeChangeView
Source-agnostic file tree change display mode.
FileTreeSuffixPriority
Truncation priority for right-aligned FileTree change metadata.
GanttTaskStart
GanttTaskStatus
HeatmapCellMode
Rendering strategy for heatmap cells.
HeatmapLegendWidth
Horizontal layout mode for the heatmap legend.
HexAreaEditKind
Edit kind emitted by HexArea.
ImageFormat
Supported image formats for clipboard operations.
InlineStartupPolicy
Startup behavior for transcript inline mode.
MouseEncoding
Mouse protocol encoding.
MouseMode
Mouse reporting mode requested by PTY application.
OverlayScope
Controls whether overlay-like widget content renders at the root or inline.
ParsedDiagram
Parsed Mermaid diagram data supported by DocumentView.
PasteShiftInsertBehavior
Determines what Shift+Insert should paste.
ScreenBackground
How the root viewport background is painted before the UI tree renders.
ScrollAxis
Scroll axes enabled on a scroll container.
ScrollBehavior
How programmatic scroll targets are applied.
ScrollChildExitDirection
Direction in which a previously visible child exited the viewport.
ScrollChildVisibility
Visibility classification for a child in a ScrollView viewport.
ScrollTarget
Semantic target for framework-owned ScrollView navigation.
ScrollWheelBehavior
How user wheel input is applied.
SentinelEvent
Lifecycle event emitted when sentinels change.
StateKind
The kind of node a StateSpec represents, controlling how it is rendered.
SurfaceMode
Public surface mode taxonomy for app rendering.
TerminalColor
Terminal color type used by custom visual effects. ANSI Color
TextAreaDecorationKind
Decoration rendering mode for TextAreaDecoration.
TextAreaImageMode
Whether images are embedded inline in the text value (sentinel chars) or displayed as attachment chips above the text input area.
TextAreaLineNumberMode
Line-number display mode for the built-in TextArea gutter.
TextAreaNewlineBinding
Controls which Enter key combinations insert new lines in TextArea.
TextAreaSentinelClickKind
A clicked inline sentinel inside a TextArea.
TextAreaStateChangeReason
TextAreaVimCurrentLineHighlight
Current-line highlighting mode for TextArea::vim_config.
TextAreaVimMode
TextArea-only Vim-style modal motion mode.
TextEditKind
The kind of text edit that occurred.
TextEncoding
Column encoding used when projecting byte offsets to text positions.
ToastCopyAffordance
Visual affordance used for copyable toasts.
ToastPlacement
Toast positioning on screen.
TripleClickSelectionMode
Behavior used for triple-click text selection.
VirtualTextPlacement
Placement for TextAreaVirtualText.

Constants§

DEFAULT_PREVIEW_MAX_HEIGHT
Default maximum height (cells) for a DragPreview::SourceSnapshot float preview.
DEFAULT_PREVIEW_MAX_WIDTH
Default maximum width (cells) for a DragPreview::SourceSnapshot float preview.
IMAGE_SENTINEL_BASE
First Unicode Private Use Area character used as an inline image sentinel. Each image at index i in the images list is represented by char::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§

ClipboardProvider
Abstraction over clipboard backends.
TextAreaColorStrategy
Strategy for applying per-line styling to text content.
ThemableProps
Trait for component properties that can be themed.

Functions§

apply_syntect_strategy_app_theme
Applies a Theme to a SyntectStrategy held in an Rc, matching ThemeProvider sharing semantics: unique Rcs are mutated in place; shared Rcs are cloned and replaced.
child
Create a nested component element.
insert_sentinel
Insert a custom sentinel into value at cursor, appending it to sentinels.
language_from_path
Resolve a language name from a file path using default syntect syntax definitions.
rank_search_palette_indices
Returns indices into items in SearchPalette fuzzy-match order (best match first).
rank_search_palette_indices_with_score
Returns indices into items in SearchPalette fuzzy-match order after score adjustment.

Type Aliases§

FileTreeGitView
Compatibility alias for the previous Git-specific display mode name.
Result
Crate-wide result type.
TextAreaColorLines
Per-line styled spans. Each entry corresponds to a logical line.