Skip to main content

Crate ftui

Crate ftui 

Source
Expand description

FrankenTUI public facade crate.

§Role in FrankenTUI

This crate is the user-facing entry point for the ecosystem. It re-exports the most commonly used types from the internal crates (core/render/layout/ runtime/widgets/style/text/extras) so application code does not need to wire each crate individually.

§What belongs here

  • Stable public surface area (re-exports).
  • Minimal glue and convenience APIs.
  • A lightweight prelude for day-to-day use.

§How it fits in the system

  • Input layer: provided by ftui-core
  • Runtime loop: provided by ftui-runtime
  • Render kernel: provided by ftui-render
  • Layout, text, style, and widgets: provided by their respective crates
  • This crate ties them together for application authors.

If you only depend on one crate in your application, it should be ftui.

Re-exports§

pub use error::DegradationAction;
pub use error::Error;
pub use error::LayoutError;
pub use error::ProtocolError;
pub use error::RenderError;
pub use error::Result;
pub use error::TerminalError;
pub use error::WidgetError;
pub use ftui_core as core;
pub use ftui_layout as layout;
pub use ftui_render as render;
pub use ftui_runtime as runtime;
pub use ftui_style as style;
pub use ftui_text as text;
pub use ftui_widgets as widgets;

Modules§

error
FrankenTUI error model and graceful degradation (bd-1q5.19).
prelude

Structs§

App
Builder for creating and running programs.
Buffer
A 2D grid of terminal cells.
BufferDiff
The diff between two buffers.
Cell
A single terminal cell (16 bytes).
CellAttrs
Packed cell attributes:
ClipboardEvent
A clipboard event from OSC 52 response.
ColorCache
Simple hash cache for downgrade results (bounded; clears on overflow).
CursorManager
Manages cursor save/restore operations.
Cx
Capability context handle.
CxController
Control handle for a Cx.
EffectQueueConfig
Configuration for effect queue scheduling.
Frame
Frame = Buffer + metadata for a render pass.
GraphemePool
A reference-counted pool for complex grapheme clusters.
InlineAutoRemeasureConfig
Policy for remeasuring inline auto UI height.
KeyEvent
A keyboard event.
LabClock
A manually-advanceable clock for deterministic tests.
LinkRegistry
Registry for OSC 8 hyperlink URLs.
LocaleContext
Runtime locale context with scoped overrides.
LocaleOverride
RAII guard for scoped locale overrides.
Modifiers
Modifier keys that can be held during a key event.
MouseEvent
A mouse event.
PackedRgba
A compact RGBA color.
PasteEvent
A paste event from bracketed paste mode.
Presenter
State-tracked ANSI presenter.
Program
The program runtime that manages the update/view loop.
ProgramConfig
Configuration for the program runtime.
ResolvedTheme
A theme with all colors resolved to fixed values.
Rgb
RGB color (opaque).
RuntimeDiffConfig
Runtime-level configuration for diff strategy selection.
Style
Unified styling type with CSS-like cascading semantics.
StyleFlags
Text attribute flags (16 bits for extended attribute support).
StyleId
Identifier for a named style in a StyleSheet.
StyleSheet
A registry of named styles for consistent theming.
TableTheme
Shared theme for all table render paths.
TaskSpec
Scheduling metadata for background tasks.
TerminalCapabilities
Terminal capability model.
TerminalWriter
Unified terminal output coordinator.
Theme
A theme with semantic color slots.
ThemeBuilder
Builder for creating custom themes.

Enums§

AdaptiveColor
An adaptive color that can change based on light/dark mode.
Ansi16
ANSI 16-color indices (0-15).
ClipboardSource
The source of clipboard content.
Cmd
Commands represent side effects to be executed by the runtime.
Color
A color value at varying fidelity levels.
ColorProfile
Terminal color profile used for downgrade decisions.
CursorSaveStrategy
Strategy for cursor save/restore operations.
CxError
Error returned when an operation is cancelled or times out via Cx.
Event
Canonical input event.
KeyCode
Key codes for keyboard events.
KeyEventKind
The type of key event.
MonoColor
Monochrome output selection.
MouseButton
Mouse button identifiers.
MouseEventKind
The type of mouse event.
ResizeBehavior
Resize handling behavior for the runtime.
ScreenMode
Screen mode determines whether we use alternate screen or inline mode.
TablePresetId
Built-in TableTheme preset identifiers.
UiAnchor
Where the UI region is anchored in inline mode.

Traits§

Model
The Model trait defines application state and behavior.

Functions§

current_locale
Convenience: get the global locale.
detect_system_locale
Detect the system locale from environment variables.
set_locale
Convenience: set the global locale.

Type Aliases§

Locale
Locale identifier (e.g., "en", "en-US", "ru").