A3S Docs
A3S TUI

Rendering And Testing

Incremental rendering, markdown, streaming, animation/theme support, examples, tests, and benchmarks.

Rendering And Testing

A3S TUI renders an element tree into a terminal grid, then writes only the lines that changed. This makes it suitable for streaming agent output where most of the screen is stable between frames.

Rendering Pipeline

StageModuleRole
Layoutlayout_engine, layout, TaffyCompute boxes from Flexbox-like constraints.
Paintpaint, gridPaint styled text and component output into cells.
Diffdiff, rendererCompare previous and next frames and emit incremental changes.
Terminalterminal, CrosstermApply output, alternate screen, input, resize, mouse, and cursor behavior.

Text rendering uses display-width helpers, so ANSI styling and CJK-width text can be measured without corrupting layout.

Rich Text And Streaming

ModuleCapability
markdownCommonMark rendering with syntax highlighting through syntect.
streamingReal-time text streaming for LLM-style output.
animationEasing, frame animation, and transitions.
themeTheme tokens for consistent color and style choices.

Examples

The crate includes examples for counter apps, chat UI, dashboard, data table, forms, layout, markdown, mouse input, styles, theme/animation, widgets, and the full component demo.

Run focused examples from crates/tui:

cargo run --example counter_element
cargo run --example demo
cargo run --example chat

Tests And Benchmarks

CheckWhat it covers
cargo test --test terminal_integrationHeadless terminal pipeline from element tree through layout, grid painting, ANSI snapshots, resize, truncation, and incremental diff changes.
cargo bench --bench renderingHot rendering paths, width helpers, major components, markdown, and viewport selection rendering.

For normal crate work, run focused checks from crates/tui, not the monorepo root.

Boundaries

  • It is a terminal renderer, not a browser or native GUI framework.
  • It does not own A3S Code's agent loop or model/tool execution.
  • It does not replace persistence, event transport, or security policy.
  • Component APIs are Rust-first; application authors build terminal interfaces by composing models, messages, elements, and components.

On this page