go-tui - terminal UIs in Go with inline mode, flexbox, and single-frame rendering
I've been building go-tui, a terminal UI framework for Go inspired by the templ framework. You write HTML-like syntax and Tailwind-style classes in .gsx files, compile them to type-safe Go, and the framework handles layout and rendering.
A couple features I think are especially relevant here:
You can render out a single frame to the terminal scrollback if you don't care about UIs and just want to place a box, table, or other styled component into your stdout. It avoids the headache of dealing with ANSI escape sequences directly and works well for CLI tools where a full TUI is overkill.
It also supports an inline mode that lets you embed an interactive widget in your shell session instead of taking over the full screen. When it exits, your shell prompt comes back normally. There's also PrintAbove() and StreamAbove() for pushing content above the widget while it's running. I used this to build a chat interface that streams responses from Claude in the terminal, with the text input sitting at the bottom and responses printing above it.
At runtime there's a flexbox layout engine based on yoga that handles positioning. It does row/column, justify, align, gap, padding, percentage widths, min/max constraints. A double-buffered renderer diffs output to minimize terminal writes.
I built full editor support for the .gsx filetype too. VS Code and Open-VSX extension with completion, hover, and go-to-definition. Tree-sitter grammar for Neovim/Helix. An LSP that proxies Go features through gopls.
There are roughly 20 examples in the repo, from basic components to a dashboard with live metrics, sparklines, and a scrollable event log.
Docs & guides: https://go-tui.dev
Posted Mar 8, 2026, 1:12 PM UTC