Model.
Available components
List
Filterable, paginated list with static arrays or dynamic data sources.
Text input
Single-line input with placeholder, character limit, and echo modes.
Textarea
Multi-line editor with cursor movement, line numbers, and word operations.
Viewport
Scrollable content area for long text with keyboard and mouse navigation.
Table
Interactive table with column definitions, row data, and keyboard navigation.
Spinner and Progress
Loading spinners and animated progress bars with spring physics.
Other components
FilePicker, Paginator, Stopwatch, Timer, Cursor, and Help.
The Elm Architecture
TUI4J follows the Elm Architecture: every model has three methods.
Each Bubbles component is itself a
Model. You embed the component as a field in your own Model and delegate update and view calls to it.
Embedding a component
The pattern is the same for every component:Always reassign the component field from
result.model() after calling update(). Components are updated immutably — the returned model may be a new instance.Starting the program
Pass your root model toProgram and call run():
Program drives the message loop, renders each frame, and delivers key, mouse, and window-size messages to your model automatically.