Introduction
TamboUI is a Java library for building terminal user interfaces. The design follows Rust’s ratatui closely - same rendering model, similar widget APIs, familiar layout system. If you know ratatui, you’ll pick this up quickly.
|
TamboUI is still experimental and under active development. APIs may change. Feedback, issues, and contributions are welcome! |
Key Features
-
Immediate-mode rendering - Redraw the entire UI each frame for simple state management
-
Intermediate buffer system - Widgets render to a buffer, enabling diff-based terminal updates
-
Constraint-based layout - Flexible layout system with percentage, fixed, ratio, and proportional sizing
-
Multiple backends - JLine 3, Panama (FFM), and Aesh for cross-platform terminal support
-
High-level TUI framework - TuiRunner eliminates boilerplate with built-in event handling
-
Declarative Toolkit DSL - Fluent API for building UIs with components and focus management
-
PicoCLI integration - Optional module for CLI argument parsing
-
GraalVM native image support - Compile to native executables for instant startup
Module Overview
| Module | Description |
|---|---|
|
Core types: Buffer, Cell, Rect, Style, Layout, Text primitives, and layout widgets (Columns, Grid, Dock, Stack, Flow) |
|
All widget implementations (Block, Paragraph, List, Table, Chart, etc.) |
|
JLine 3 terminal backend |
|
Panama (FFM) terminal backend for modern JDKs |
|
Aesh terminal backend |
|
High-level TUI framework with TuiRunner, event handling, bindings, and key helpers |
|
Fluent DSL for declarative UI construction with components and focus management |
|
CSS-based styling with TCSS format, selectors, and theme switching |
|
Annotation definitions ( |
|
Annotation processor for compile-time action handler generation |
|
Image rendering with Kitty, iTerm, Sixel, and braille protocols |
|
Optional PicoCLI integration for CLI argument parsing |
Where to Start
Building a full-screen TUI application? Start with Getting Started, then move to the Toolkit DSL section. From there, explore Forms, CSS Styling, and Bindings as needed.
Building a CLI tool with progress output? See Inline Toolkit for npm/Gradle-style progress displays.
Want to understand the internals? Read Core Concepts first, then explore Immediate Mode or TuiRunner.
Foundations
-
Getting Started - Installation and hello world
-
Core Concepts - Architecture and primitives
-
API Levels - Immediate mode, TuiRunner, Toolkit DSL, Inline Display
Building Blocks
These work at any API level:
-
Widgets Reference - Block, Paragraph, List, Table, Chart, etc.
-
Layouts Reference - Columns, Grid, Dock, Stack, Flow
-
Markup Text - BBCode-style text formatting
-
CSS Styling - External stylesheets and theming
Toolkit DSL
-
Forms - Form abstractions with validation
-
Bindings and Actions - Input handling and @OnAction
-
Application Structure - MVC patterns
Advanced
-
Developer Guide - Creating custom widgets
Quick Example
Here’s a minimal example using the Toolkit DSL:
import static dev.tamboui.toolkit.Toolkit.*;
import dev.tamboui.toolkit.app.ToolkitApp;
import dev.tamboui.toolkit.element.Element;
public class HelloTamboUI extends ToolkitApp {
@Override
protected Element render() {
return panel("Hello",
text("Welcome to TamboUI!").bold().cyan(),
spacer(),
text("Press 'q' to quit").dim()
).rounded();
}
public static void main(String[] args) throws Exception {
new HelloTamboUI().run();
}
}
License
TamboUI is released under the MIT License.