gotui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of tcell. It is a modern fork of termui, inspired by ratatui and written purely in Go by Carsen Klock.
This is a modern fork of termui for 2025, heavily upgraded to support TrueColor, modern terminal events, better performance, and new layouts.
gotui is compatible with Go 1.24+.
- Backend: Native
tcellsupport for TrueColor (24-bit RGB), mouse events, and resize handling. - Gauges: Progress bars and gauges.
- Charts:
- BarChart: Stacked and standard bar charts.
- PieChart: Pie and Donut charts.
- RadarChart: Spider/Radar charts.
- TreeMap: Hierarchical data visualization.
- FunnelChart: Process flow/conversion charts.
- Sparkline: Mini sparklines.
- Plot: Line, Scatter, and Braille-mode charts.
- Maps:
- World Map: High-resolution world map example using the generic
Canvaswidget (see_examples/canvas.go).
- World Map: High-resolution world map example using the generic
- New Widgets:
- LineGauge: Thin, character-based progress bar with alignment options (Block, Dots, custom runic styles).
- Scrollbar: Ratatui-compatible scrollbars (Vertical/Horizontal) with mouse and keyboard support.
- Logo: Pixel-perfect block-style logo renderer.
- Performance:
- Optimized Rendering:
Bufferuses flat slices for O(1) access, providing 2-3x speedup. - Zero Allocations: Drawing loops minimized for high-fps scenes (~3000 FPS potential).
- Optimized Rendering:
- Layout:
- Grid: Responsive grid layout.
- Tabs: Tabbed navigation.
- Interactive: Calendar, Tables, Input, TextArea.
- Styling:
- Rounded Borders: Optional rounded corners for blocks.
- Full RGB Color support.
- Border titles (Top and Bottom) with alignment (Left, Center, Right).
- Rich styling parser for text.
- Collapsed Borders: Support for merging adjacent block borders using
BorderCollapse.
- Compatibility: Works with modern terminals (iTerm2, Kitty, Alacritty, Ghostty).
It is not necessary to go get gotui, since Go will automatically manage any imported dependencies for you.
go get github.com/metaspartan/gotui/v4package main
import (
"log"
ui "github.com/metaspartan/gotui/v4"
"github.com/metaspartan/gotui/v4/widgets"
)
func main() {
if err := ui.Init(); err != nil {
log.Fatalf("failed to initialize gotui: %v", err)
}
defer ui.Close()
p := widgets.NewParagraph()
p.Text = "Hello World!"
p.SetRect(0, 0, 25, 5)
ui.Render(p)
for e := range ui.PollEvents() {
if e.Type == ui.KeyboardEvent {
break
}
}
}Run an example with go run _examples/{example}.go or run each example consecutively with make run-examples.
(Submit your projects via a PR)
gotui Author: Carsen Klock - X
termui Author: Zack Guo - Github
