Crate tuxtui_core

Crate tuxtui_core 

Source
Expand description

§tuxtui-core

Core types and traits for the tuxtui Terminal UI library.

This crate provides the foundational building blocks for terminal user interfaces:

  • Style: Colors, modifiers, and styling primitives
  • Text: Rich text with spans, lines, and paragraphs
  • Buffer: Double-buffered terminal cell storage with efficient diffing
  • Layout: Flexible constraint-based layout engine with caching
  • Backend: Platform-agnostic terminal abstraction trait
  • Theme: Themable UI components with serialization support

§Features

  • std (default): Enable standard library support
  • layout-cache: Enable LRU caching for layout calculations
  • serde: Enable serialization/deserialization
  • palette: Enable advanced color manipulation with HSL/HSLuv
  • portable-atomic: Use portable atomics for no-std compatibility
  • anstyle: Enable anstyle conversions
  • underline-color: Enable colored underlines
  • scrolling-regions: Enable terminal scrolling region support

§Example

use tuxtui_core::{buffer::Buffer, geometry::Rect, style::{Color, Style}};

let mut buffer = Buffer::empty(Rect::new(0, 0, 10, 5));
let style = Style::default().fg(Color::Blue);
buffer.set_string(0, 0, "Hello", style);

Modules§

backend
Platform-agnostic terminal backend trait.
buffer
Double-buffered terminal cell storage with efficient diffing.
event
Event handling types and utilities.
geometry
Geometric primitives for terminal layout.
layout
Flexible constraint-based layout engine with caching.
prelude
Convenient re-exports for common types and traits.
style
Style primitives for terminal text and widgets.
symbols
Symbol sets for box drawing and UI elements.
terminal
Terminal management and frame orchestration.
text
Rich text primitives for styled terminal content.
theme
Theme system for consistent styling across widgets.
util
Utility functions and helpers.
viewport
Viewport state management for scrollable content.