State that redraws only what reads it.
Signal and Computed track dependencies while your view runs. Change a value; glyphora invalidates the right work without reducers, dispatch loops, or dependency arrays.
A reactive, batteries-included toolkit for terminal apps that feel designed—not assembled. Typed views, real widgets, expressive motion, and native binaries from one coherent stack.
mvn"com.worxbend::tui-dsl:0.18.3"Each layer is useful alone. Together they cover the path from state mutation to the final ANSI diff—without reflection or a browser-shaped architecture.
Signal and Computed track dependencies while your view runs. Change a value; glyphora invalidates the right work without reducers, dispatch loops, or dependency arrays.
Compose inputs, tables, markdown, trees, charts, forms, loading states, and rich layout primitives without leaving typed Scala.
Top bar, sidebar, status hints, themes, screen stacks, toasts, and a fuzzy command palette share one key registry.
Fade, sweep, coalesce, dissolve, pulse, and typewriter transforms compose with easing—without contaminating widget logic.
GraalVM native-image works with --no-fallback and no reflect-config. Compile-time Scala 3 derivation keeps runtime honest.
Unicode display width comes from generated UCD tables. Grapheme-aware measuring, wrapping, clipping, and editing are foundational—not patches.
Run complete input and render cycles against HeadlessBackend. Pilot types, clicks, resizes, waits, and exposes the terminal exactly as a user sees it.
The runtime records signal reads, rebuilds the element tree, renders widgets into a headless buffer, and flushes only changed cells. The exact pipeline powers production and tests.
Walk through the architecture →Three ideas carry from a hello-world counter to dashboards, forms, file pickers, and full-screen tools.
Put mutable values in Signal. Derive everything else with Computed.
val filter = Signal("")Return an Element tree from view. Layout and style stay typed and local.
panel("Jobs")(dataTable(state))Run on the JVM, test headlessly, or compile a zero-reflection native binary.
./mill app.nativeImageAdd one dependency, declare the keys, and return an element tree. The status bar is generated from the same bindings that dispatch commands.
import io.worxbend.tui.dsl.*
class CounterApp extends TuiApp:
private val count = Signal(0)
override def bindings: KeyBindings = KeyBindings(
binding("+", "increment")(count.update(_ + 1)),
binding("q", "quit")(quit()),
)
def view(using ReactiveScope, Theme): Element =
scaffold(statusBar = Some(statusBar(bindings))) {
centered(34, 7) {
panel("Counter")(
text(s"count: ${count.get}").bold.fg(Color.Cyan),
text("press + to increment").dim,
).rounded
}
}
object Counter extends CounterApp