Skip to content

Enum & Type Reference ​

Quick reference for all public enums and types used in widget props and API calls.

Convention: When a prop table shows a type like ButtonVariant, look it up here.


Automation ​

TypeVariants / purpose
ClockModeRealtime, Controlled (default)
SemanticRoleStable roles such as Button, TextBox, Dialog, List, Tree, and Terminal
SemanticCheckedFalse, True, Mixed
SemanticActionClick, Focus, SetValue, Toggle, Scroll, Drag, Expand, Collapse
ValueSensitivityPublic, Sensitive, Masked
SelectorExplicit Id, Role, TextContains, or unstable Point strategy
WaitConditionExists, Missing, InView, Focused, Enabled, Selected, ValueEquals, TextContains, Count
CheckpointSinkMarkdown, Json, Png, RecordingMarker, Baseline
CheckpointBaselineCreated, Matched { ratio }, Updated

AutomationStep is intentionally opaque; construct operations with methods such as click, focus, resize, advance, wait_for, and checkpoint.

Clipboard mouse behavior ​

TypeVariants / purpose
CopyOnSelectDisabled, PrimarySelection, Clipboard, Both
PasteSourceDisabled, PrimarySelection, Clipboard
RightClickActionDisabled, PasteClipboard, CopyOrPaste
PasteShiftInsertBehaviorPrimarySelection, Clipboard

PrimarySelection is the Linux select-to-copy buffer normally pasted with the middle mouse button. It is separate from the regular clipboard used by Ctrl+C and Ctrl+V.

Text Coordinates ​

TextPosition ​

Zero-based logical text coordinate:

FieldTypeNotes
lineusizeLogical line index
columnusizeUnicode-scalar column by default

TextRange ​

Half-open text range with start: TextPosition and end: TextPosition.

TextEncoding ​

Column encoding for LineIndex conversions:

VariantMeaning
Utf8Column is a byte offset from the line start
Utf16Column is a UTF-16 code-unit offset from the line start
UnicodeScalarColumn is a Unicode scalar count from the line start (default)

LineIndex ​

Snapshot helper for converting between canonical byte offsets and TextPosition / TextRange. Rebuild it when the underlying text changes.

SelectionEnd ​

Controls how a normalized GridSelection endpoint is interpreted:

VariantMeaning
Exclusive (default)The endpoint is the first grid position not selected
InclusiveThe endpoint cell is included, for cell-cursor copy modes

UI Snapshots (agent / design review) ​

UiWidgetKind ​

Typed widget tag on each UiWidgetDesc entry (Frame, List, Input, …). Implements Display.

UiWidgetDesc ​

FieldTypeNotes
kindUiWidgetKindWidget type
keyOption<Key>Reconciliation key
rectRectLayout bounds
focused / hoveredboolInteraction state
title / label / valueOption<String>Semantic text
placeholderOption<String>Input placeholder (distinct from label)
value_maskedboolWhen true, value is intentionally omitted
checkbox_stateOption<CheckboxState>Tri-state checkbox value
selected_index / scroll_offsetOption<usize>List/tab selection and scroll
item_labels / total_itemsOption<…>List/table preview; total_items set when labels truncated
child_countOption<usize>Structural containers

UiSnapshot ​

Combined CapturedFrame + widgets + focus_key / hover_key. Methods: to_markdown(); with ui-snapshot-json feature: to_json(), to_json_pretty(); with ui-snapshot-png feature: to_png(&PngOptions), to_png_default() (both return Result<Vec<u8>>), baseline(dir) → SnapshotBaseline.

Headless: TestBackend::capture_ui_snapshot() after render(). Live: Context::request_ui_snapshot_to(path), request_ui_snapshot_to_slot(&UiSnapshotSlot), and request_ui_snapshot(Callback<UiSnapshot>) — delivered after the next paint; TestBackend serves them on render()/pump(). Context::observe_painted_frames(Callback<PaintedFrame>) is the passive counterpart: it delivers every paint without causing any, until its PaintSubscription is dropped. TestBackend::baseline(dir) and UiSnapshot::baseline(dir) compare a capture against a stored PNG (name, tolerance, check, assert_baseline); TUI_LIPAN_UPDATE_BASELINES=1 accepts the current render. TestBackend::advance(dt) / Sketch::advance(dt) / TUI_LIPAN_SNAPSHOT_ADVANCE_MS settle time-gated UI before capture. TestBackend::advance_frame(dt) is the one-frame clamp. Virtual advancement affects tui-lipan-managed time only; application Instant::now() is not advanced.

CursorShape ​

Shape of a captured cursor, in CursorState::shape. Unlike CaretShape, which says what a widget asks for, this is what a capture found.

VariantNotes
Block (default)Filled cell; also the shape when the capture cannot know it
HollowBlockOutlined cell
UnderlineLine under the cell
BarVertical line at the cell's left edge

PngOptions (ui-snapshot-png) ​

Options for CapturedFrame::to_png(&PngOptions) and UiSnapshot::to_png(&PngOptions).

The PNG also draws CapturedFrame::images, such as a terminal pane's Kitty graphics, scaled into the cells that still show them; text and ANSI output carry a ▀ half-block stand-in instead. See terminal-images.md.

PngOptions and PngTextRenderer are exported from the crate root, not the prelude:

rust
#[cfg(feature = "ui-snapshot-png")]
use tui_lipan::{PngOptions, PngTextRenderer};
FieldTypeDefaultNotes
cell_widthu168Cell width in pixels before scaling
cell_heightu1616Cell height in pixels before scaling
scaleu162Output cell scale multiplier
default_fgColorColor::WhiteFallback when a cell foreground resolves to reset/transparent
default_bgColorColor::BlackFallback when a cell background resolves to reset/transparent/backdrop
ansi_palette[Color; 16]xterm valuesColors for the 16 ANSI slots; a named color and its Indexed(0..16) form both paint with their slot
render_cursorbooltrueDraw the captured cursor, in its shape and color, when visible
text_rendererPngTextRendererAutoAuto uses fonts when found and falls back to bitmap; Font tries font rendering first with the same fallback; Bitmap forces coarse cell glyphs
font_familyOption<Arc<str>>NonePreferred system font family, e.g. a Nerd Font
font_pathOption<PathBuf>NoneExplicit font file path; takes precedence over family lookup

PngTextRenderer (ui-snapshot-png) ​

Controls PNG text rasterization: Auto (default) renders antialiased text from installed fonts when there are any, then falls back to the built-in font8x8 bitmap renderer; Font requests font rendering with the same family/path selection; Bitmap forces deterministic coarse cell rendering. Use font_family or font_path for system/Nerd Font captures, and force Bitmap when stable fallback-style screenshots matter more than glyph fidelity.

The font renderer tries font_path, then font_family, then a list of common monospace families. A character none of those has is looked up across every installed face, so CJK text, symbols, and emoji draw whenever some font on the system covers them. Emoji and text followed by U+FE0F prefer a color bitmap font such as Noto Color Emoji, drawn in its own colors. Combining marks are drawn over their base character. There is no text shaping: a joined emoji sequence such as a family draws its first member only.

Box-drawing and block characters (U+2500-U+259F) are drawn from geometry in every renderer, as terminals draw them: lines meet the cell edges exactly and join their neighbors, light lines follow the underline thickness and heavy ones are twice that, double lines keep their outer strokes around corners, ╭╮╯╰ are anti-aliased arcs, diagonals are anti-aliased, and eighths, quadrants and shades fill exact fractions of the cell. The few characters mixing single and double lines are left to the font.

Powerline separators (U+E0B0-U+E0BF) are drawn from geometry the same way, so no Nerd Font is needed for them. Arrows, half circles, and corner triangles span the full cell and meet the edge they close, so a CapStyle::Arrow or CapStyle::Round cap joins its segment without a background seam. The thin variants follow the light line thickness.

Any other private-use icon, such as a Nerd Font symbol, is never cut at its cell edge. Followed by a blank of the same background, it may run into that blank, as terminals allow; an icon wider than the room it has is scaled down to fit.

The bitmap renderer covers ASCII, Latin-1, Greek, box drawing, and blocks. It has no combining marks and draws the base character of such a sequence alone; anything else becomes a missing-glyph box.

Underlines follow CellModifiers::underline: single, double, curly, dotted, and dashed each have their own shape. An underline with no color of its own takes the text color.

Cost ​

Font discovery and every glyph a renderer rasterizes are kept for the life of the process, per font_path/font_family pair, so only the first capture pays for them. Encoding holds that shared renderer for the whole frame: concurrent font-backed encodes run one at a time. Font data is memory-mapped from the installed files, not copied.

Measured on Linux with 776 installed faces, a 120x36 terminal frame, scale: 1, release build:

Time
Bitmap, each frame~2-3 ms
Font, first frame in the process~20-30 ms, most of it discovering fonts
Font, each later frame~2-3 ms
First character no preferred font hasup to ~115 ms, the worst-case full search; once per character

Binary size added by ui-snapshot-png to a stripped release binary (thin LTO, one codegen unit, panic = "abort") that already uses terminal-images:

Renderer linkedAdded
Bitmap only~130 KB
Font and Bitmap~480 KB

A binary that never selects Font or Auto still links the font renderer; the figures above show what it would take to drop it.


Input Keymaps ​

PanKeymap ​

Bitflag-style key set for PanView: NONE, ARROWS, VIM, and DEFAULT (ARROWS | VIM). Combine sets with | and test with .contains(...). VIM includes h/j/k/l cardinal panning.

FrameworkAction ​

Framework-owned actions configurable from Rust via FrameworkKeymap and App::framework_keymap(...). Maps to internal keymap actions after file/env/user bindings are applied.

VariantDefault binding (typical)FrameworkKeymap use
Quitctrl-q.unbind(FrameworkAction::Quit) or rebind
DismissOverlayescOverlay dismissal
FocusNexttabTab traversal
FocusPrevshift-tabReverse tab traversal
ToggleDevToolsf12DevTools panel (requires devtools feature at runtime)

Sugar: App::global_quit(None) unbinds quit without touching other framework actions.

FrameworkKeymap ​

Builder for Rust-side framework binding overrides. Applied after user keymap files and built-in defaults. Methods: .bind(action, KeyBindings), .unbind(action).

UserKeymapPolicy ​

VariantBehavior
Enabled (default)Load App::keymap_path, TUI_LIPAN_KEYMAP, or default user keymap
DisabledIgnore user keymap files; built-in defaults and Rust FrameworkKeymap still apply

KeyDispatchPolicy ​

Non-terminal focus ordering between widgets and app command shortcuts.

VariantBehavior
WidgetFirst (default)Focused widget and bubble run before app command shortcuts
AppCommandsFirstApp command shortcuts run before focused widget handlers (command chords still first)

TerminalKeyPolicy ​

Terminal-focused key ordering. See widgets/terminal.md.

VariantSummary
FrameworkFirst (default)Framework shortcuts before terminal passthrough
AppCommandsThenTerminalMux-style: terminal copy/paste preflight, then app commands, then PTY
TerminalFirstTerminal forwarding before app commands
TerminalOnlyNo app command or framework fallback while terminal is focused

CommandConflictPolicy ​

Resolves duplicate executable shortcuts on CommandEntry.

VariantBehavior
FirstRegistered (default)Stable registration order among equal priorities
HighestPriorityHighest CommandEntry::priority(i32), then first registered

ChordMismatchPolicy ​

Behavior when a key fails to complete a pending app command chord.

VariantBehavior
SwallowPrefixReplayCurrent (default)Swallow the prefix; retry the mismatching key as a fresh dispatch
ForwardPrefixAndCurrentForward both prefix and mismatching key to lower-priority sinks
CancelOnlyCancel pending command state; treat mismatch as unhandled by commands

CopyModeAction ​

Result of TerminalCopyMode::handle_key:

VariantMeaning
IgnoredNo copy-mode binding handled the key, or a motion was already at its boundary
MovedCursor or scrollback position changed without an active selection
SelectionChangedSelection anchor or anchored cursor position changed
RequestCopyCopy the current selection
CancelLeave copy mode without copying

HintKind and HintFilter ​

HintKind identifies scanner output as Url, Path, GitSha, or Custom(u16). HintFilter reports incremental label filtering as NoMatch, Ambiguous, or Selected(usize).


Layout & Sizing ​

Length ​

VariantMeaningDefault for
Length::AutoSize to contentLeaf widgets (Text, Button, Input, etc.)
Length::Px(u16)Fixed cell count-
Length::Percent(u16)Percentage of available space (clamped to 0..=100)-
Length::Flex(u16)Proportional share of remaining spaceContainers (VStack, HStack, Frame)

ShrinkPriority ​

Controls stack shrink order for widgets that opt into custom layout constraints.

VariantEffect
ShrinkPriority::NormalDefault shrink order
ShrinkPriority::FirstYield space before normal siblings, for lower-priority reflowing groups

Align (cross-axis) ​

VariantEffect
Align::StartTop/left (default)
Align::CenterCentered
Align::EndBottom/right
Align::StretchFill available space

Justify (main-axis) ​

VariantEffect
Justify::StartPack toward start (default)
Justify::CenterCenter in available space
Justify::EndPack toward end
Justify::SpaceBetweenEven space between children (none at edges)
Justify::SpaceAroundEven space around each child
Justify::SpaceEvenlyEqual space between and around children

Orientation ​

VariantUsage
Orientation::HorizontalHorizontal divider, horizontal splitter
Orientation::VerticalVertical divider, vertical splitter

SplitterHandleMode ​

Where a Splitter places its drag handles relative to pane borders. This is independent of whether neighboring frames merge their borders.

VariantDescription
SplitterHandleMode::GutterReserve a gutter between panes and draw the handle glyph there (default)
SplitterHandleMode::BorderDrop the gutter and ride the pane border seam (thickness adapts to borders actually present)

Padding ​

Create via conversion:

rust
Padding::from(1u16)               // uniform: all sides = 1
Padding::from((2u16, 1u16))       // (vertical, horizontal)
Padding::from((1u16, 2u16, 1u16, 2u16))  // (top, right, bottom, left)

Or use the .padding(...) builder which accepts impl Into<Padding>:

rust
.padding(1)           // uniform
.padding((2, 1))      // (vertical, horizontal)
.padding((1, 2, 1, 2))  // (top, right, bottom, left)

FloatRect ​

Fractional terminal-cell rectangle with x, y, w, and h fields as f32. Transition<FloatRect> interpolates geometry field-by-field; use .to_rect() to round and clamp the current value before passing it to widgets such as Canvas.


Visual Style ​

BorderStyle ​

VariantAppearance
BorderStyle::Plain─ │ ┌ ┐ └ ┘ (default)
BorderStyle::Rounded─ │ ╭ ╮ ╰ ╯
BorderStyle::Double═ ║ ╔ ╗ ╚ ╝
BorderStyle::Thick━ ┃ ┏ ┓ ┗ ┛
BorderStyle::LightDoubleDashedDashed light border
BorderStyle::HeavyDoubleDashedDashed heavy border
BorderStyle::LightTripleDashedTriple-dashed light
BorderStyle::HeavyTripleDashedTriple-dashed heavy
BorderStyle::LightQuadrupleDashedQuadruple-dashed light
BorderStyle::HeavyQuadrupleDashedQuadruple-dashed heavy
BorderStyle::Custom { glyphs }Custom glyph set via BorderGlyphs

BorderEdges ​

VariantEffect
BorderEdges::AllReserve and render all four border edges (default)
BorderEdges::HorizontalCapsReserve only top/bottom rows and render corner caps; left/right content columns are not consumed

BorderMergeMode ​

Strategy used when frame border symbols overlap (e.g. adjacent or overlapping frames).

VariantDescription
BorderMergeMode::ReplaceLast write wins; no symbol merging (clean overlap override)
BorderMergeMode::ExactMerge only when an exact box-drawing intersection symbol exists (default)
BorderMergeMode::FuzzyMerge using the closest matching symbol when an exact merge symbol is unavailable

Fuzzy/Exact merge box-drawing glyphs only; on a seam that already carries a neighbor's border they leave that neighbor's border-title text (and spaces next to it) alone. Ordinary underlay content is still replaced. Plain backdrop spaces still accept a border. Replace still overwrites so an occluding frame can wipe the seam.

TabEdge ​

Which border line a Frame draws its tab strip on. Tabs share the line with that border's own labels.

VariantEffect
TabEdge::TopDraw tabs on the top border, beside the header labels (default)
TabEdge::BottomDraw tabs on the bottom border, beside the footer labels

Bottom tabs suit a frame anchored to the bottom of its container: that edge stays put, so the strip keeps its screen position while the body above it changes height. A compact frame has one line and draws its tabs there whatever the edge says.

CapStyle and CapSides ​

Badge uses these enums for optional segment caps. Tabs and DraggableTabBar accept the same named sets through CapStyle::chars() passed to .caps(...).

CapStyle variantEffect
CapStyle::PaddedKeep the segment undecorated (default)
CapStyle::HalfFont-safe half-block caps (U+2590 / U+258C)
CapStyle::RoundRounded Powerline caps (U+E0B6 / U+E0B4)
CapStyle::ArrowPointed Powerline caps (U+E0B2 / U+E0B0)

CapSides::Both (default) draws both ends; Left and Right draw one end, while None disables both. CapStyle::requires_nerd_font() identifies Round and Arrow; font_safe() degrades either to Padded. An explicitly selected Half remains unchanged. CapStyle::all() returns the canonical style cycle. CapStyle::chars() returns Option<(char, char)> for tab widgets (None for Padded); glyphs() returns the string form used by Badge.

Overflow ​

VariantEffect
Overflow::AutoWidget-specific default overflow behavior
Overflow::ClipClip overflowing content at the end
Overflow::ClipStartClip from the start, keeping the tail visible
Overflow::EllipsisTruncate overflowing content with …
Overflow::WrapSoft-wrap content to the available width

CaretShape ​

VariantDescription
CaretShape::BlockBlock cursor (█) (default - do not set explicitly)
CaretShape::BarVertical bar cursor (│)
CaretShape::UnderlineUnderline cursor (_)

CaretPalette ​

Global caret defaults for editable text-entry widgets. ThemePalette derives CaretShape::Block and the palette accent color by default. Individual Input, TextArea, and embedded SearchPalette query inputs can override either field with their caret setters.

FieldTypeDescription
shapeCaretShapeDefault hardware caret shape
colorOption<Color>Default OSC 12 hardware caret color

ScrollbarVariant ​

VariantDescription
ScrollbarVariant::StandaloneSeparate column consuming content width (default)
ScrollbarVariant::IntegratedIntegrate into right border (lazygit-style)

ScrollBehavior ​

Controls programmatic target scrolling for ScrollView::scroll_to, ScrollView::scroll_to_key, DocumentView::scroll_to_source_line, and TextArea::scroll_to_line.

VariantDescription
ScrollBehavior::InstantSnap directly to the resolved target row (default)
ScrollBehavior::Smooth(TransitionConfig)Animate to the target row using the provided transition timing
ScrollBehavior::SmoothDistance(ScrollDistanceConfig)Animate to the target row with duration derived from row distance

Use ScrollBehavior::smooth_default() for a fixed default transition, or ScrollBehavior::smooth_adaptive() for distance-based timing. Overshooting easing curves are clamped to the start/end row range so terminal scroll offsets do not jitter past their target.

ScrollWheelBehavior ​

Controls user mouse-wheel scrolling for ScrollView.

VariantDescription
ScrollWheelBehavior::ImmediateApply wheel steps as discrete line jumps (default)
ScrollWheelBehavior::Smooth(ScrollWheelConfig)Add wheel steps to an inertial velocity and decay it over animation ticks

Use ScrollView::smooth_wheel_scroll(true) for the default smooth physics, or ScrollWheelBehavior::smooth(config) when passing physics as data.

ScrollTarget ​

Semantic target for framework-owned ScrollView navigation.

VariantDescription
ScrollTarget::TopResolve to the current top edge
ScrollTarget::BottomResolve to the current bottom extent
ScrollTarget::Key(Key)Resolve to the first child subtree containing the key
ScrollTarget::KeyOffset { key, offset }Resolve to the first child subtree containing the key, then add offset rows

Use ScrollView::scroll_to_bottom() / scroll_to_top() for edge targets, or ScrollView::scroll_to(ScrollTarget::Bottom) when passing the target as data.

ScrollChildVisibility ​

Used by ScrollViewportEvent for immediate ScrollView children.

VariantDescription
ScrollChildVisibility::FullyVisibleThe child rect is fully inside the effective viewport
ScrollChildVisibility::PartiallyVisibleThe child is clipped by the effective viewport

ScrollChildExitDirection ​

Used by ScrollExitedChild when a previously visible immediate ScrollView child leaves the viewport.

VariantDescription
ScrollChildExitDirection::AboveThe child is now fully above the viewport
ScrollChildExitDirection::BelowThe child is now fully below the viewport
ScrollChildExitDirection::RemovedThe child identity is gone or no longer has measurable geometry

Easing ​

Built-in transition curves used by TransitionConfig and animated widgets.

VariantDescription
Easing::LinearConstant-rate interpolation
Easing::EaseInQuadQuadratic acceleration
Easing::EaseOutQuadQuadratic deceleration
Easing::EaseInOutCubicCubic acceleration and deceleration
Easing::EaseInOutSineSinusoidal acceleration and deceleration
Easing::EaseOutElasticDecaying repeated overshoot
Easing::EaseOutBack { overshoot_permille }One overshoot followed by a settle; amplitude is thousandths of the animated distance
Easing::CubicBezier(curve)CSS/Hyprland cubic Bézier timing curve

Easing::EASE_OUT_BACK selects the standard easings.net curve with a 100 permille (10%) overshoot. 0 produces a plain cubic ease-out. Values above animation::MAX_BACK_OVERSHOOT_PERMILLE (500) saturate at that ceiling.

Create a custom curve with CubicBezier::new(x1, y1, x2, y2). The x coordinates must be in [0, 1]; y coordinates may undershoot or overshoot. Construction rejects non-finite values.

ScrollDistanceConfig ​

Distance-based timing for smooth target scrolling. Duration is computed as min_duration + duration_per_row * distance_rows, then capped by max_duration. Defaults: 120ms minimum, 700ms maximum, 8ms per row, Easing::EaseOutQuad.

FieldDescription
min_durationBaseline duration for non-zero jumps
max_durationCap for long jumps
duration_per_rowAdded duration per resolved target row
easingEasing curve for the generated transition

ScrollWheelConfig ​

Physics parameters for opt-in smooth wheel scrolling. Defaults: 40.0 acceleration, 12.0 deceleration, 320.0 max velocity, and 0.05 stop velocity, all in content rows/second terms.

FieldDescription
accelerationVelocity impulse added per wheel line
decelerationExponential velocity decay per second; higher values stop sooner
max_velocityAbsolute velocity clamp
stop_velocityVelocity threshold below which inertial scrolling settles

ColorTransform ​

Used with Style::transform_fg(...), Style::transform_bg(...), EffectScope, and VisualEffect::ColorTransform. Every variant carries one strength, an EffectAmount; the lowercase constructors accept anything Into<EffectAmount>, so ColorTransform::dim(0.5) works with a plain f32.

VariantConstructorDescription
Dim(EffectAmount)ColorTransform::dim(amount)Dim the resolved color toward black by 0.0..=1.0
Lighten(EffectAmount)ColorTransform::lighten(amount)Lighten the resolved color toward white by 0.0..=1.0
Elevate(EffectAmount)ColorTransform::elevate(amount)Raise the resolved color off its own background by 0.0..=1.0, the relative form of Color::elevate_by, and available on Style as .elevate_by(f32): lightens a dark color, dims a light one, and preserves hue and chroma
Opacity(EffectAmount)ColorTransform::opacity(factor)Compose the resolved paint alpha with the factor; 1.0 keeps the paint, 0.0 resolves to the backdrop for that channel
OpacityToward { factor, target }ColorTransform::opacity_toward(factor, target)Same factor semantics as Opacity, but blend toward target instead of the backdrop
Tint(Color, EffectAmount)ColorTransform::tint(color, alpha)Blend the resolved color toward a target color by alpha

amount() reads a transform's strength and with_amount(...) replaces it.

EffectAmount ​

The strength of a ColorTransform: an 8-byte Copy value that is either fixed or late-bound. Late-bound amounts keep the element tree unchanged while they move, so they animate with repaints instead of view() passes.

FormBuilt withBehavior
Fixedf32.into(), EffectAmount::fixed(f32)A plain number
Transitionctx.animated_amount(key, target, config), ctx.animated_amount_with_frame_rate(...)Moves toward target; the animation registry ticks it and asks for paint-only frames
Pulsectx.pulsing_amount(key, EffectPulse::new(from, to))Oscillates from → to → from while the view keeps reading key; starts at from when key first appears, or at EffectPulse::starting_at(elapsed) on the runtime clock, sampled at the pulse's frame rate by the animation registry

Accessors: as_fixed(), is_transition(), is_pulse(), is_late_bound(), and resting_value() (the fixed value, the transition's target, or the pulse's from). Outside a paint, a late-bound amount resolves to its resting value; with terminal-serde it serializes as that number.

EffectPulse builder: period(Duration) (default 1.5 s), easing(Easing) (default EaseInOutSine, applied to each half of the cycle), and frame_rate(u16) (default 30, clamped to 1..=480). value_at(Duration) evaluates it at a point on its own timeline. A pulse's value only changes on a sample, so all paints between two samples agree on it, and samples follow the runtime clock, so a stalled loop does not slow it. A pulse no full paint reads is suspended until one does. Asking for the same key with animated_amount instead settles the pulse from wherever it is. Keys are local to the component instance that uses them.

A late-bound amount or paint names its animation by an AnimationHandle: a registry slot plus a generation. A slot is freed when its animation is dropped and reused under the next generation; once a slot's generations are spent it retires instead of wrapping, so no two handles in a runtime are ever equal and a handle left in an old tree falls back to its resting value instead of naming a later occupant. A pulse hidden while its timeline ran on shows its latest sample on the paint that reveals it.

An animation belongs to the component instance that requested it for as long as that instance is mounted and keeps asking for it. A memoized component whose cached subtree is reused without running view() keeps its animations running; they are dropped when its view() runs without requesting them, or when it unmounts.

Handles never cross terminal-serde: an EffectAmount serializes as its resting value and a Paint::Animated as the solid colour it resolves to, so another runtime cannot resolve a handle against its own registry.

Image pixels never follow a late-bound amount frame by frame: a transition is baked at its target (one re-encode for the whole fade), and a pulse is left out of image pixels. A fixed amount does reach them, so a signal that must never recolor a picture - whether it holds still or breathes - belongs in an EffectScope::cells_only() scope.

Paint ​

Alpha-aware style-channel color. Style::fg, Style::bg, and Style::underline_color store Option<Paint> and accept Color directly via From<Color>.

VariantMeaning
Paint::Solid(Color)Opaque terminal color or semantic sentinel
Paint::Alpha { color, alpha }Source pigment with 0..=255 alpha, composited before terminal output
Paint::Animated { handle, fallback }A colour the renderer resolves while painting, from ctx.animated_color(...); fallback is used once the animation is gone

Construct with Paint::solid(Color), Paint::rgb(r,g,b), Paint::rgba(r,g,b,a), or Paint::hex("#RRGGBBAA"). Color::Transparent and Color::Backdrop keep their sentinel meanings only when used as solid paint; Paint::Alpha { alpha: 0, .. } is an alpha paint that preserves the backdrop for that channel, not the transparent sentinel.

ThemeRole ​

Semantic roles resolved by Theme::role(...) and StyleSlot state overlays.

VariantResolves from / purpose
ThemeRole::BaseDefault widget text/surface style (theme.primary)
ThemeRole::AccentInteractive accent/emphasis, falling back to primary foreground
ThemeRole::SelectionSelected/current item style (theme.selection)
ThemeRole::TextSelectionText/range selection style (theme.text_selection)
ThemeRole::UnfocusedSelectionUnfocused selection style; currently follows Selection
ThemeRole::HoverGenuine pointer-hover state (theme.hover)
ThemeRole::DragSourceDrag-source active overlay; currently follows Hover for compatibility
ThemeRole::DropTargetFuture inactive drop-zone affordance; currently follows Hover
ThemeRole::DropTargetActiveCompatible-drag-over-target highlight; currently follows Hover
ThemeRole::FocusFocused widget chrome (theme.focus)
ThemeRole::ActiveActive/current state; currently follows Selection
ThemeRole::ItemHoverPer-row/per-item hover; currently follows Hover
ThemeRole::BorderFrame/divider border role (primary.patch(border))
ThemeRole::DisabledDisabled widget content (primary.patch(muted))
ThemeRole::MutedSecondary content (primary.patch(muted))
ThemeRole::ErrorError/status color
ThemeRole::InputFocusContentFocused text content for Input
ThemeRole::TextAreaFocusContentFocused content for TextArea
ThemeRole::DocumentViewFocusContentFocused content for DocumentView
ThemeRole::HexAreaFocusContentFocused content for HexArea
ThemeRole::HexAreaCursorHex-area cursor style
ThemeRole::TerminalFocusContentFocused terminal content
ThemeRole::ScrollbarThumbScrollbar thumb color
ThemeRole::ScrollbarThumbFocusFocused scrollbar thumb color
ThemeRole::ScrollbarTrackScrollbar track color
ThemeRole::SplitterHoverSplitter hover handle color
ThemeRole::SplitterActiveSplitter active handle color

VisualEffect ​

Used with EffectScope::effect(...), EffectScope::effects(...), and MouseRegion::hover_effect(...).

VariantDescription
VisualEffect::Monochrome { strength }Desaturate fg/bg colors toward grayscale
VisualEffect::PaletteQuantize { palette }Quantize fg/bg colors to an effect palette
VisualEffect::Scanlines { strength, spacing }Dim every spacing rows
VisualEffect::RainbowWave { blend, frequency, speed, axis }Animated color wave sampled in scope-local coordinates; supports foreground-only or background-only output through the channel restriction methods
VisualEffect::Gradient { gradient, blend, frequency, speed, axis }Mirrored ColorGradient wash sampled in scope-local coordinates; supports foreground-only or background-only output through the channel restriction methods
VisualEffect::RetroCrt { preset, flicker, scanline_strength }Retro CRT preset with palette, scanlines, and optional flicker
VisualEffect::Ripple { origin, radius, ring_width, tint, strength }Aspect-correct radial tint ring from an explicit or aligned EffectOrigin; radius is a RippleRadius
VisualEffect::Clipped { bounds, mask, inner }Restrict another effect to a scope-local rect and/or mask
VisualEffect::Channels { channels, inner }Restrict another effect to EffectChannels::Both, Foreground, or Background
VisualEffect::ColorTransform { fg, bg }Apply relative ColorTransforms to fg and/or bg
VisualEffect::ContrastPolicy(policy)Apply readable-foreground contrast adjustment
VisualEffect::Custom(Arc<dyn CellEffect>)User-defined per-cell effect; can optionally prepare frame-constant state with CellEffect::prepare, and composite over the cells beneath its scope with CellEffect::uses_backdrop / apply_with_backdrop

EffectOrigin ​

Used by positional effects such as VisualEffect::Ripple.

VariantDescription
EffectOrigin::Cell { x, y }Explicit scope-local cell coordinates; use EffectOrigin::cell(x, y)
EffectOrigin::Aligned(EffectAlignment)Resolve from the current effect-scope bounds at render time

EffectAlignment ​

Two-dimensional alignment for EffectOrigin::Aligned. Common constants: TOP_LEFT, TOP_CENTER, TOP_RIGHT, CENTER_LEFT, CENTER, CENTER_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT.

RippleRadius ​

Used by VisualEffect::Ripple.

VariantDescription
RippleRadius::Fixed(f32)Static ring radius in character columns
RippleRadius::Loop { max_radius, period_ticks }Repeating ease-out shockwave with implicit linear strength fade
RippleRadius::Once { max_radius, duration_ticks, start_tick }One-shot ease-out shockwave; capture start_tick from ctx.effect_phase() when the burst starts

Color (selected variants) ​

Full listing: named ANSI colors, Indexed(u8), Rgb, hex / hex_u24 helpers. Highlights:

Variant / formDescription
Color::ResetTerminal default for that attribute (ANSI reset)
Color::BackdropBackground-only surface semantic: blank areas clear foreground content but preserve the background color already beneath them
Color::TransparentOmit fg/bg when rendering so cells keep the color underneath; in Style::patch, does not override the resolved base for that channel

TripleClickSelectionMode ​

Used by TextArea::triple_click_mode(...) and DocumentView::triple_click_mode(...).

VariantDescription
TripleClickSelectionMode::LineSelect the current logical/rendered line (default)
TripleClickSelectionMode::ParagraphSelect the current paragraph bounded by blank lines

HeatmapCellMode ​

VariantDescription
HeatmapCellMode::BackgroundFill each cell with a background color and optional numeric text (default)
HeatmapCellMode::Glyph(Arc<str>)Draw a centered glyph string over a colored background tile
HeatmapCellMode::GlyphForeground(Arc<str>)Draw only the glyph string in the mapped color, leaving the background untouched

HeatmapLegendWidth ​

VariantDescription
HeatmapLegendWidth::GridAlign the legend with the heatmap grid start (default)
HeatmapLegendWidth::FullLet the legend span the full inner width, including the row-label gutter

ActorKind (SequenceDiagram) ​

VariantDescription
ActorKind::ParticipantRender as a participant box (default)
ActorKind::ActorRender as a Mermaid-style stick-figure actor with a label

SequenceDiagramVariant (SequenceDiagram) ​

VariantDescription
SequenceDiagramVariant::BoxedRender participant headers/footers with boxes (default)
SequenceDiagramVariant::MinimalRender compact unboxed participant labels; actor labels use actor_glyph or the "○ " fallback

SequenceDiagramTheme (SequenceDiagram) ​

SequenceDiagramTheme is a public struct for diagram-local styles and glyphs. Use SequenceDiagramTheme::classic() for the default look, SequenceDiagramTheme::minimal() for the compact preset, and SequenceDiagramTheme::ascii() when output must avoid Unicode box-drawing characters. The theme contains public sub-structs for the customizable glyph and style groups: MessageGlyphs, FragmentGlyphs, LifelineTheme, ActivationTheme, and AutonumberTheme, plus participant/note border slots for diagram-local chrome.

MessageStyle and FragmentKind index the per-kind style slots used by SequenceDiagram::message_kind_style(...) and SequenceDiagram::fragment_kind_style(...).

Flowchart enums ​

TypeVariants
FlowDirectionTopDown (default), BottomUp, LeftRight, RightLeft
NodeShapeRect (default), Round, Stadium, Subroutine, Cylinder, Circle, Asymmetric, Diamond, Hexagon, Parallelogram, ParallelogramAlt, Trapezoid, TrapezoidAlt, DoubleCircle
EdgeStyleSolid (default), Dashed, Thick, Invisible
EdgeArrowNone, Open, Filled (default), Cross, Circle

FlowchartTheme is a diagram-local glyph/style bundle with classic(), minimal(), and ascii() presets.

Gantt diagram enums ​

TypeVariants
GanttTaskStatusPending (default), Active, Done, Critical
GanttTaskStartDate(GanttDate), After(Arc<str>)

GanttDuration::days(n) stores day-based task lengths. GanttTask::milestone() marks a zero-duration task rendered as a milestone glyph.

MessageStyle (SequenceDiagram) ​

VariantMermaid formDescription
MessageStyle::Sync-> / ->>Solid request/call arrow
MessageStyle::Async-) / async arrowSolid asynchronous/open-head arrow
MessageStyle::SyncReply-->Dashed reply arrow with filled head
MessageStyle::AsyncReply-->>Dashed reply arrow with open head
MessageStyle::Lost-xMessage ending in a lost/error marker
MessageStyle::Open-)Message ending in an open circle marker

Prefer constructor helpers such as SequenceMessage::sync(...), SequenceMessage::async_(...), and SequenceMessage::reply(...) unless you need to set a style directly.

FragmentKind (SequenceDiagram) ​

VariantDescription
FragmentKind::LoopRepeated block (loop)
FragmentKind::AltConditional block with else branches (alt)
FragmentKind::OptOptional block (opt)
FragmentKind::ParParallel block with and branches (par)
FragmentKind::CriticalCritical section (critical)
FragmentKind::BreakBreak/abort block (break)
FragmentKind::RectBackground rectangle region (rect)

NotePlacement (SequenceDiagram) ​

VariantDescription
NotePlacement::LeftOfNote box to the left of one actor
NotePlacement::RightOfNote box to the right of one actor
NotePlacement::OverNote box spanning one or more actors

Widget Variants ​

ChartSeriesMode ​

VariantDescription
ChartSeriesMode::Line (default)Connected whole-cell glyphs configured by point_char and line_char
ChartSeriesMode::BrailleDense connected trace using a 2x4 subcell grid per terminal cell
ChartSeriesMode::BarsVertical bars configured by bar_char

SpinnerStyle ​

VariantFrames
SpinnerStyle::Dots (default)⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏
SpinnerStyle::LineFour-frame line spinner
SpinnerStyle::Circle◐◓◑◒
SpinnerStyle::Arc◜◠◝◞◡◟
SpinnerStyle::Braille⣾⣽⣻⢿⡿⣟⣯⣷
SpinnerStyle::Moon🌑🌒🌓🌔🌕🌖🌗🌘
SpinnerStyle::Box▖▘▝▗
SpinnerStyle::Bar▂▃▄▅▆▇█▇▆▅▄▃▂
SpinnerStyle::Arrow←↖↑↗→↘↓↙
SpinnerStyle::Fade█▓▒░▒▓
SpinnerStyle::TrailMoving shaded trail
SpinnerStyle::Earth🌍🌎🌏
SpinnerStyle::Claude·✢✳✶✻*✻✶✳✢
SpinnerStyle::OpenCodeCustom OpenCode-style glowing track
SpinnerStyle::ThreeDotThree-dot chase
SpinnerStyle::ThreeDotFadeThree-dot chase with trail
SpinnerStyle::SquareFadeSquare fill/fade
SpinnerStyle::LightsaberCustom lightsaber ignition/retraction

SpinnerSpeed ​

VariantDescription
SpinnerSpeed::SlowApprox. 200 ms per frame
SpinnerSpeed::Normal (default)Approx. 100 ms per frame
SpinnerSpeed::FastApprox. 50 ms per frame
SpinnerSpeed::Custom { frame_ms }Custom milliseconds per frame, quantized to the runtime spinner tick

DraggableTabKind ​

VariantDescription
DraggableTabKind::TabRegular selectable, draggable tab (default)
DraggableTabKind::ActionPinned action item, such as a + new-tab button, that emits on_action instead of selecting or reordering

DraggableTabBarVariant ​

VariantDescription
DraggableTabBarVariant::BorderedSegmented tabs with dividers (default)
DraggableTabBarVariant::FrameLineOne-line frame-like tabs with accent markers

DraggableTabBarOverflow ​

VariantDescription
DraggableTabBarOverflow::ScrollKeep natural tab widths and scroll horizontally when tabs overflow (default)
DraggableTabBarOverflow::ShrinkThenScroll { min_tab_width }Shrink tab labels down to the configured minimum tab width before scrolling

DragReorderMode ​

VariantDescription
DragReorderMode::LiveEmit reorder events as the drag crosses tab boundaries (default)
DragReorderMode::OnDropEmit one reorder event when the mouse is released

ButtonVariant ​

VariantRendered asConstructor shortcut
ButtonVariant::Bracket[ Label ] (default)Button::new("Label")
ButtonVariant::FilledBackground-filled (no brackets)Button::filled("Label")
ButtonVariant::OutlinedBorder-only (no background)Button::outlined("Label")

CheckboxVariant ​

VariantCheckedUncheckedIndeterminate
CheckboxVariant::Bracket (default)[x][ ][-]
CheckboxVariant::Circle◉○◍
CheckboxVariant::Box✓☐▣
CheckboxVariant::Switch●○◐
CheckboxVariant::Custom { checked, unchecked, indeterminate }Custom strings

CheckboxState ​

VariantDescription
CheckboxState::UncheckedNot checked
CheckboxState::CheckedChecked
CheckboxState::IndeterminatePartial/unknown state

RadioLayout ​

VariantDescription
RadioLayout::VerticalStack options vertically (default)
RadioLayout::HorizontalStack options horizontally

Note: Radio uses CheckboxVariant::Circle by default (not Bracket).

ListItemRole ​

VariantDescription
ListItemRole::NormalRegular selectable row (default)
ListItemRole::HeaderNon-selectable section header
ListItemRole::SpacerNon-selectable blank row

ListSymbolPosition ​

VariantDescription
ListSymbolPosition::LeftRender the symbol in the left symbol column (default)
ListSymbolPosition::RightRender the symbol immediately after the label content

ListTruncation ​

VariantDescription
ListTruncation::EndKeep the start of a list description and end it with … (default)
ListTruncation::StartKeep the end of a list description and start it with …

DescriptionPlacement (SearchPalette) ​

VariantDescription
DescriptionPlacement::Inlinelabel - description on primary line (default)
DescriptionPlacement::RightDescription in right-aligned slot on primary line
DescriptionPlacement::AboveDescription line above label
DescriptionPlacement::BelowDescription line below label

DescriptionOverflow (SearchPalette) ​

VariantDescription
DescriptionOverflow::TruncateKeep descriptions on one visual line and truncate with ellipsis (default)
DescriptionOverflow::WrapWrap descriptions across multiple lines for DescriptionPlacement::Above and DescriptionPlacement::Below

SearchMatchMode (SearchPalette) ​

VariantDescription
SearchMatchMode::FuzzyPlain nucleo fuzzy matching across label, aliases, and description; label matches outrank synonym-only alias hits (default)
SearchMatchMode::HybridExact/prefix/word-prefix/substring/fuzzy tiers evaluated independently per field (label, aliases, description, right-hand hint) and ranked in that priority order; any label hit outranks a synonym-only alias hit; weak scattered fuzzy matches are quality-gated and rejected. See docs/widgets/overlays.md (Matching config).

MultiSelectDescriptionPlacement ​

VariantDescription
MultiSelectDescriptionPlacement::Inlinelabel - description on primary line (default)
MultiSelectDescriptionPlacement::RightDescription in right-aligned slot on primary line
MultiSelectDescriptionPlacement::AboveDescription line above label
MultiSelectDescriptionPlacement::BelowDescription line below label

MultiSelectDescriptionOverflow ​

VariantDescription
MultiSelectDescriptionOverflow::TruncateKeep descriptions on one visual line and truncate with ellipsis (default)
MultiSelectDescriptionOverflow::WrapWrap descriptions across multiple lines for MultiSelectDescriptionPlacement::Above and MultiSelectDescriptionPlacement::Below

Focus & Input ​

FocusPolicy ​

VariantBehavior
FocusPolicy::OnDemandStart unfocused; Tab, pointer focus, or explicit APIs establish focus. Retain keyed identity across temporary unmounts. Default.
FocusPolicy::AutoFocus the first eligible target at startup and when no prior target can be restored.
FocusPolicy::ManualDisable global Tab traversal, click-to-focus, tag fallback, and first-target fallback. Explicit APIs and capturing-overlay traps remain active.

FocusScope ​

VariantBehavior
FocusScope::NoneNormal inherited traversal. Default.
FocusScope::ExcludeExclude the subtree from traversal, automatic/pointer focus, and fallback; explicit keyed requests may enter it.
FocusScope::ContainWrap next/previous traversal within the nearest containing ancestor while focus is inside.

FocusSizing ​

VariantUsage
FocusSizing::NoneNo focus-aware sizing (default)
FocusSizing::Accordion(FocusAccordion { ... })Lazygit-style panel resizing

FocusSizing controls stack geometry and is distinct from app-level FocusPolicy.

Grid track Length (.rows / .columns) ​

ValueEffect
Length::AutoTrack sizes from content (subject to spanning rules) (default)
Length::Px(n)Fixed track size
Length::Percent(n)Resolves against the grid's inner width or height
Length::Flex(n)Shares remaining space along that axis with other flex tracks

Implicit rows are added as Auto when auto-flow runs out of space.

FocusAccordion ​

FieldTypeDefaultDescription
focused_minu167Minimum height for focused child
collapsedu163Height for non-focused children
tiny_collapsedu161Height in tight-space mode
expanded_weightu162Flex weight multiplier for focused child
squash_thresholdu1628Viewport height to enter squashed mode
tiny_thresholdu1621Viewport height to enter tiny mode

TextAreaNewlineBinding ​

VariantEnter key behavior
TextAreaNewlineBinding::EnterEnter inserts newline (default)
TextAreaNewlineBinding::ShiftEnterShift+Enter inserts newline
TextAreaNewlineBinding::EnterOrShiftEnterBoth insert newline

TextAreaLineNumberMode ​

Controls how built-in TextArea line numbers are displayed when TextArea::line_numbers(true) is enabled.

VariantDescription
TextAreaLineNumberMode::AbsoluteShow one-based logical line numbers (default)
TextAreaLineNumberMode::RelativeShow Vim-style relative numbers: the cursor line stays absolute and other lines show their distance from it

TextAreaVimMode ​

Emitted by TextArea::on_vim_mode_change when TextArea::vim_motions(true) is enabled.

VariantDescription
TextAreaVimMode::InsertPlain text insertion mode
TextAreaVimMode::NormalVim-style normal/motion mode; enabled TextAreas start here (default)
TextAreaVimMode::VisualVim-style visual selection mode; motions extend the cursor/anchor selection
TextAreaVimMode::VisualLineVim-style linewise visual selection mode; motions extend a whole-logical-line selection

TextAreaVimKeymap / TextAreaVimKeyBinding ​

Widget-local Vim key remaps for TextArea::vim_motions(true). A TextAreaVimKeymap contains TextAreaVimKeyBinding entries that translate single-key KeyBindings into canonical Vim command characters before TextArea Vim dispatch. These remaps are separate from keymap.conf and only run while the TextArea is not in Insert mode.

TextAreaVimConfig / TextAreaVimCurrentLineHighlight ​

TextAreaVimConfig groups Vim-only rendering options used by TextArea::vim_config(...):

FieldDescription
search_bar_styleStyleSlot for the bottom Vim search/status bar
search_bar_prefix_styleStyleSlot overlay for the Vim search bar prefix icons; unset fields fall through to search_bar_style
search_bar_count_styleStyleSlot overlay for Vim search count labels like [2/5]; unset fields fall through to search_bar_style
search_match_styleStyleSlot patched over visible matches while Vim search feedback is shown
current_search_match_styleStyleSlot patched over the current Vim search match; during pending search this is the match Enter would jump to, and after Enter it follows n / N
current_line_highlightOptional current-line highlight mode
current_line_styleStyleSlot for current-line highlighting
current_line_number_styleStyleSlot overlay for the current line number/custom gutter row; unset fields fall through to current_line_style
VariantDescription
TextAreaVimCurrentLineHighlight::OffDisable current-line highlighting (default)
TextAreaVimCurrentLineHighlight::ContentHighlight only text content rows for the cursor's logical line
TextAreaVimCurrentLineHighlight::FullHighlight the full inner row, including line numbers or custom gutter

KeyBinding / KeyBindings ​

Public shortcut binding types from tui_lipan::input. Parsing: whitespace = chord steps, comma = alternatives. See keybindings.md.

TypeDescription
KeyBindingOne shortcut or chord (FromStr, Display, from_key_event, matches_sequence, conflicts_with, is_chord, step_count, label, to_source, canonical, canonical_lowercase)
KeyBindingsComma-separated alternatives (FromStr, Display, label, to_source, canonical_lowercase, iter, primary, is_empty, len)
ChordMatcher<T>Stateful incremental matcher for chords (feed, reset, is_pending)
ChordResult<T>None / Pending / Matched from ChordMatcher::feed
KeyBindingParseErrorParse error type for invalid binding strings

label() and Display give keycap notation for people, to_source() the stable spelling for config files, and canonical() the identity string; see keybindings.md. String helpers:

  • format_binding(...) / format_bindings(...) return labels
  • format_binding_lowercase(...) / format_bindings_lowercase(...) return lowercase canonical text
  • KeyMods::label() writes held modifiers in label order (Ctrl+Shift)

SentinelId ​

Opaque Copy id for a custom inline sentinel. SentinelId::UNKNOWN is 0 when no id was set on a removed token. New ids are assigned by insert_sentinel (via internal SentinelId::next()).

SentinelEvent ​

VariantPayloadWhen
SentinelEvent::Deleted { id, sentinel }Stable id (or UNKNOWN), full TextAreaSentinel including payloadUser edit removed the sentinel char from the buffer

Emitted by: TextArea::on_sentinel_event (batched).

TextAreaSentinel ​

Builder-style struct (not an enum): new(label), style, focus_style, hover_style, payload<T>(data), id(SentinelId), get_payload, sentinel_id. Equality compares label, styles, and id (payload is ignored).

TextAreaSentinelClickKind ​

VariantPayloadWhen
TextAreaSentinelClickKind::Image { index, image }Inline image index and ImageContentUser clicked an inline image placeholder
TextAreaSentinelClickKind::Custom { index, id, sentinel }Custom sentinel index, stable id, and metadata including payloadUser clicked a custom sentinel label

TextAreaSnapshot ​

FieldDescription
value, cursor, anchorBuffer and caret state
sentinelsParallel custom sentinel metadata
images, image_modeSame fields as on TextArea

Methods: TextAreaSnapshot::capture(&TextArea), apply(self, TextArea) -> TextArea, diff(&self, &Self) -> Vec<SentinelEvent> (stable ids removed between snapshots).

TextAreaImageMode (requires feature image) ​

VariantDescription
TextAreaImageMode::InlineUnicode PUA sentinels embedded in text value
TextAreaImageMode::AttachmentImages in separate list; text value unchanged

Overlay & Toast ​

ToastPlacement ​

VariantPosition
ToastPlacement::TopStartTop-left
ToastPlacement::TopCenterTop-center
ToastPlacement::TopEndTop-right
ToastPlacement::BottomStartBottom-left
ToastPlacement::BottomCenterBottom-center
ToastPlacement::BottomEndBottom-right (default)

ToastCopyAffordance ​

VariantBehavior
ToastCopyAffordance::NoneNo visual copy control; copyable toasts still copy on right-click
ToastCopyAffordance::BorderGlyphShow a copy glyph in the top border when the toast has a border (default)

App Configuration ​

ContrastPolicy ​

Used by App::contrast_policy(...), widget-level .contrast_policy(...) builders, and Style::contrast_policy(...) for per-style overrides.

VariantBehavior
ContrastPolicy::WcagAuto-adjust low-contrast text using WCAG 2.1 contrast (default)
ContrastPolicy::BlackOrWhiteKeep the current foreground if it already passes WCAG; otherwise snap to black or white
ContrastPolicy::ApcaAuto-adjust using APCA perceptual contrast
ContrastPolicy::OffPreserve explicit colors exactly

TaskPolicy ​

VariantBehavior
TaskPolicy::QueueAllEnqueue every task; native workers may run same-key tasks concurrently
TaskPolicy::DropIfRunningIgnore new task while one with same key is running without cancelling the active task
TaskPolicy::LatestOnlyKeep only newest pending task, cancel the active token, and cancel replaced pending tokens

LatestOnly cancellation is cooperative. Background work must poll its CommandLink / CancellationToken and use send_if_not_cancelled to avoid delivering stale messages.


Data Widgets ​

IndentStyle ​

Used by Tree::indent_style(...) and inherited by FileTree for hierarchy guide glyphs.

VariantGlyphs
IndentStyle::NoneNo guides
IndentStyle::Line│
IndentStyle::Short├, └
IndentStyle::Long├─, └─
IndentStyle::ShortRounded├, ╰
IndentStyle::LongRounded├─, ╰─

FileTreeChangeView ​

VariantDescription
FileTreeChangeView::AllFilesBrowse all files under the configured root (default)
FileTreeChangeView::ChangedOnlyShow only changed paths and ancestor directories from the configured change source

FileTreeGitView is a compatibility alias for FileTreeChangeView.

FileTreeEntrySource ​

VariantDescription
FileTreeEntrySource::LocalEnumerate the local filesystem (default)
FileTreeEntrySource::Provided(Vec<FileTreeDirectoryListing>)Use completed directory listings supplied by the application; absent listings are pending and requested asynchronously

FileTreeDirectoryListing::new(path, entries) supplies one successful directory result. FileTreeDirectoryListing::error(path, error) supplies a failed result. Each FileTreeEntry contains its relative name, directory and symlink flags, an optional symlink target, optional GitFileStatus, and ignore state. Use FileTreeEntry::file(name) or FileTreeEntry::directory(name) and the .symlink(...), .symlink_target(...), .git_status(...), and .ignored(...) builders. .symlink_target(...) is what a provided tree shows after a link's name, since the widget cannot follow a link that lives on another host. Successful listing entries are retained as a shared Arc<[FileTreeEntry]>, so cloning widget props does not clone every child entry.

Provided listing, change, reveal, selection, expansion, and style paths use the root's path flavor, so POSIX roots remain POSIX on Windows clients and Windows roots remain Windows on POSIX clients. Relative roots continue to resolve against the local current directory.

FileTreeChangeSource ​

VariantDescription
FileTreeChangeSource::GitRead change data from the local git repository (default)
FileTreeChangeSource::Provided(Vec<FileTreeChange>)Use application/backend-provided change rows; does not require local git and may include virtual, nonexistent, or deleted paths

FileTreeGitStatusCache ​

Clone an app-owned FileTreeGitStatusCache into FileTree::git_status_cache(...) for trees that replace one another. It keeps the last successful local Git snapshot visible across mounts while a fresh scan runs in the background. new() retains eight repository/mode snapshots; with_capacity(...) sets another bounded capacity, and clear() drops retained data.

FileTreeChangeStatus ​

VariantDescription
FileTreeChangeStatus::ModifiedExisting path has modifications
FileTreeChangeStatus::AddedPath is newly added
FileTreeChangeStatus::DeletedPath was deleted and may not exist on disk
FileTreeChangeStatus::RenamedPath was renamed
FileTreeChangeStatus::UntrackedPath is untracked by the source
FileTreeChangeStatus::ConflictedPath has a conflict

FileTreeChange ​

FileTreeChange::new(path, status) creates a provided change row. Builder methods include .kind(FileKind), .diff_stat(additions, deletions), .additions(...), .deletions(...), and .staged(...).

FileTreeItemStyle ​

Path-specific FileTree decoration style used by FileTree::path_style(...) and FileTree::path_styles(...). FileTreeItemStyle::new() starts empty; builder methods .row(...), .icon(...), .label(...), and .suffix(...) set optional styles for the whole row, leading icon, name label, and right-side metadata suffix independently.

FileTreeSuffixPriority ​

Controls what wins when a FileTree row is too narrow for both the label and right-aligned change metadata.

VariantDescription
FileTreeSuffixPriority::LabelPreserve the label and truncate suffix metadata first (default)
FileTreeSuffixPriority::SuffixPreserve suffix metadata such as M +30 -21 and truncate the label first

Diff View (feature diff-view) ​

DiffViewMode ​

VariantDescription
DiffViewMode::SplitSide-by-side view (default)
DiffViewMode::UnifiedUnified view

DiffViewBackend ​

VariantDescription
DiffViewBackend::TextAreaTextArea-backed rendering (default, editable supported)
DiffViewBackend::DocumentViewDocumentView-backed rendering (read-only optimized)

DiffPane ​

VariantDescription
DiffPane::LeftLeft pane in split mode
DiffPane::RightRight pane in split mode
DiffPane::UnifiedUnified pane

DiffLineSide ​

VariantDescription
DiffLineSide::OldResolve an inline anchor through its original/source line
DiffLineSide::NewResolve an inline anchor through its modified/source line (default)

The preferred side keeps a comment attached to the clicked half of a split replacement when switching to unified mode, where removed and added rows are rendered separately.

DiffLineRange ​

Inclusive source range used by multiline review comments:

rust
pub struct DiffLineRange {
    pub start: DiffLineAnchor,
    pub end: DiffLineAnchor,
}

DiffLineRange::new(start, end) orders endpoints that use the same source side. DiffLineRange::single(anchor) creates a one-row range. Patch ranges are valid only when both endpoints have the same hunk_index.

DiffContextSeparatorDirection ​

VariantDescription
DiffContextSeparatorDirection::AboveHidden context appears above the visible hunk
DiffContextSeparatorDirection::BelowHidden context appears below the visible hunk
DiffContextSeparatorDirection::BetweenHidden context appears between two visible hunks

DiffContextRange ​

Stable identifier for a collapsed unchanged range. Line numbers are git-style, 1-based, and inclusive when present.

rust
pub struct DiffContextRange {
    pub old_start: Option<usize>,
    pub old_end: Option<usize>,
    pub new_start: Option<usize>,
    pub new_end: Option<usize>,
}

DiffHunkAnchor ​

Logical navigation anchor for one parsed unified-patch hunk. logical_line is a zero-based rendered source row before soft wrapping; DiffView::scroll_to_hunk uses this row and lets the active backend resolve the final visual row.

rust
pub struct DiffHunkAnchor {
    pub pane: DiffPane,
    pub index: usize,
    pub old_start: Option<usize>,
    pub new_start: Option<usize>,
    pub logical_line: usize,
}

Utility Types ​

GridPos ​

A position in a 2D grid, used for mouse-driven selection in grid-like UIs.

rust
pub struct GridPos {
    pub row: usize,  // Zero-based row index
    pub col: usize,  // Zero-based column index
}

GridSelection ​

A 2D range selection with anchor (start) and cursor (current) positions.

MethodReturnsDescription
new(pos)GridSelectionCreate a new single-point selection
extend_to(pos)-Extend selection to a new cursor position
normalized()(GridPos, GridPos)Get ordered (start, end) where start <= end
is_empty()boolCheck if anchor equals cursor
contains(row, col)boolCheck if a cell is within the selection
extract_text(lines)StringExtract selected text from a slice of line strings
columns_for_row(row, line_width)Option<(usize, usize)>Get selected column range for a row (for rendering)

GridSelectionEvent ​

rust
pub struct GridSelectionEvent {
    pub selection: Option<GridSelection>,
    pub text: Option<String>,
}

Element Helpers ​

ExpressionDescription
Element::empty()Empty placeholder (use in if/else branches)
widget.into()Convert any widget into Element
widget.key("my-key")Assign stable identity for reconciliation/focus

TextArea editor primitive enums ​

  • TextAreaDecorationKind: Range, WholeLine, Underline. Byte offsets remain canonical. Underline applies the supplied style and enables underline automatically.
  • VirtualTextPlacement: Inline, Eol. Inline virtual text shifts visual columns before the anchor byte; EOL virtual text appends after a logical line's final visual row without affecting wrapping.
  • TextAreaStateChangeReason: Edit, SelectionChange, CursorMove, Scroll, VimModeChange.

MPL-2.0