Hybrid immediate-mode framework — no virtual DOM, no diffing. GPU-accelerated via Metal, OpenGL, and WebGPU. 50+ widgets, 6 companion libraries.
Pre-built showcase binaries — download and run, no Go or SDL2 required
Each frame, a plain Go function returns a layout tree — the framework sizes, positions, and renders it in one pass
View fn → Layout → Render. No virtual DOM, no diffing, no dirty tracking. Layout computes sizes in one walk; render emits draw commands in the next. GPU backends: Metal (macOS/iOS), OpenGL (Linux/Windows), WebGPU (browser).
gui.State[App](w) returns a typed pointer — no interface{} casts, no global variables, no closures over mutable state. Views are pure functions of state; testing is straightforward.
Text measurement, SVG parsing, and platform services are interfaces injected at startup. Swap backends without changing widget code. A headless test backend runs all layout and widget logic without a display server — CI-friendly.
Six libraries — each focused on one job, all built on go-gui core
Core framework — widgets, constraint layout, event system, GPU-accelerated retained-mode scene graph.
Browser-quality text rendering — BiDi, multi-grapheme clusters, complex scripts — plus vector icons and glyph rasterization.
Declarative charting — line, bar, area, pie, scatter, candlestick — incremental updates for real-time dashboards.
Text editing — single-line to multi-cursor code editor, piece-table undo, syntax highlighting, completion hooks.
Tiled raster/vector map widget with projection handling, markers, and geospatial overlays.
Embeddable terminal emulator — PTY, ANSI/VT parser, render surface as a go-gui widget.
Deep capabilities across rendering, widgets, text, and developer tooling
Metal on macOS. OpenGL on Linux and Windows. WebGPU in the browser. Every frame, a single pass sizes, positions, and renders the entire widget tree — no virtual DOM, no diffing overhead, no hidden layout passes.
Custom GPU shaders for rounded-rect clip masking, box shadows, blur effects, and color-filter post-processing. Animations run on the framework clock and integrate with the layout pass.
Hundreds of simultaneous animations, each updating independently — each composited widget managing its own state. Keyframe, spring, tween, and hero transitions. Animations run on the framework clock and integrate with the layout pass.
The spinners demo: every spinner is a standard widget with its own animation timeline. No pre-rendered sprites — each frame the pipeline sizes, positions, and renders the full tree.
Buttons, inputs, sliders, tables, trees, tabs, menus, dialogs, toasts, breadcrumbs — every widget follows the same config-struct pattern. DataGrid with built-in virtualization, sorting, grouping, inline editing, and CSV/TSV/XLSX/PDF export.
IDE-style DockLayout with drag-and-drop panel rearrangement. Canvas and DrawCanvas for custom rendering. Sidebar, CommandPalette, Form with validation — all widgets share the same config-struct pattern and event model.
Full Unicode support with bidirectional text, complex script shaping, and multi-grapheme clusters. Rich text with mixed fonts, sizes, colors, and inline styling. Gradient text, stroke outlines, affine transforms, and glyph placement on paths.
Zero-alloc draw path. Multi-page glyph atlas with automatic shelf packing and time-based eviction. IME composition with clause underlines and cursor feedback.
Line, bar, area, scatter, pie, candlestick, histogram, heatmap, radar, waterfall, and more. Interactive zoom, pan, and brush select with incremental updates for real-time dashboards.
Render to PNG or SVG with no window — 16x MSAA, export from CI, servers, or headless environments. Built-in data transforms: moving averages, regression, Bollinger bands, LTTB downsampling.
Time-travel debugging — scrub back through app state frame-by-frame with a built-in debugger window. Headless testing — runs all layout and widget logic without a display server. Theme system — dark, light, custom themes with a live theme picker widget.
Command registry with global hotkeys and a fuzzy-search command palette. 53 example apps ship with the framework. CI runs on every commit.
Single-line input to full multi-cursor code editor — go-edit handles the range. Piece-table undo with infinite history. Syntax highlighting with pluggable grammars. Completion hooks for LSP integration.
Search and replace with regex. Code folding. Diagnostics API for inline error markers. Designed to embed — use it as a widget in any go-gui window, apply custom themes, wire in language servers via completion hooks.
Tiled raster and vector maps with projection handling — OSM, WMS, and custom tile sources. Kinetic pan and zoom. Markers, polylines, polygons, and circles for geospatial overlays.
Legend, gallery, and overview companion widgets. Geospatial overlays with coordinate transforms. Every map is a standard go-gui widget — compose it with charts, tables, or forms in the same window.
One Go module, a view function, and you're done
Requires Go 1.26+ and SDL2 dev libraries — platform-specific install
go get github.com/go-gui-org/go-gui
package main
import (
"fmt"
"github.com/go-gui-org/go-gui/gui"
"github.com/go-gui-org/go-gui/gui/backend"
)
type App struct{ Clicks int }
func main() {
gui.SetTheme(gui.ThemeDarkBordered)
w := gui.NewWindow(gui.WindowCfg{
State: &App{},
Title: "Hello GUI",
Width: 300,
Height: 300,
OnInit: func(w *gui.Window) { w.UpdateView(mainView) },
})
backend.Run(w)
}
func mainView(w *gui.Window) gui.View {
app := gui.State[App](w)
return gui.Column(gui.ContainerCfg{
HAlign: gui.HAlignCenter,
VAlign: gui.VAlignMiddle,
Content: []gui.View{
gui.Text(gui.TextCfg{Text: "Hello GUI!"}),
gui.Button(gui.ButtonCfg{
IDFocus: 1,
Content: []gui.View{
gui.Text(gui.TextCfg{
Text: fmt.Sprintf("%d Clicks", app.Clicks),
}),
},
OnClick: func(l *gui.Layout, e *gui.Event, w *gui.Window) {
gui.State[App](w).Clicks++
e.IsHandled = true
},
}),
},
})
}
One Go module → native app on macOS, Windows, Linux, iOS, Android, and the browser.
The architectural thesis behind go-gui
Most GUI frameworks in Go target the browser. go-gui takes the opposite approach: hybrid immediate-mode — each frame, a plain Go view function returns a layout tree, and the framework sizes, positions, and renders it in a single pass. No virtual DOM. No JavaScript bridge. No browser runtime.
The second thesis is that a GUI toolkit should be an ecosystem of composable libraries, not a monolithic framework. go-glyph handles text. go-charts handles data. go-edit handles code. Each is a focused library usable on its own or together — all sharing the same rendering pipeline and event system.
Built by Mike Ward. All repositories are MIT-licensed and under active development. View all on GitHub →