Installation
Add Yoga to a Go module, run the demos, and install the yoga CLI.
Yoga needs Go 1.26 or newer.
go get github.com/yogaui/yogaDesktop builds use Cgo for GLFW and wgpu-native, so they need a C toolchain and generally have to be built on the target OS. Browser builds (GOOS=js GOARCH=wasm) and headless builds (-tags nogpu) do not use Cgo.
Run the demos#
Clone the repository and run an example:
go run ./example/todo # smallest app (todos)
go run ./example/catalog # component gallery (sidebar + showcases)
go run ./example/chapar # multi-page nav shell
# Headless (no window / GPU) — same UI pipeline, for CI
go run -tags nogpu ./example/todo
go build ./... && go build -tags nogpu ./... && go test ./...-tags nogpu is the only special Go build flag: it swaps GPU/GLFW files for stubs. Use the yoga CLI for packaging (web, DMG, AppImage, zip).
| Command | What it shows |
|---|---|
example/todo |
Form + list, controlled TextField / Checkbox |
example/catalog |
Sidebar catalog of widget categories; custom title bar (CustomTitleBar) |
example/chapar |
App chrome: top bar, nav, pages as Layout helpers |
The code editor has its own demos, example/gallery (an editor workspace and a widget gallery) and example/apitest (an HTTP request tester), in yogaui/editor.
The yoga CLI#
go install github.com/yogaui/yoga/cmd/yoga@latestAn app can pin the CLI next to the framework with go get -tool github.com/yogaui/yoga/cmd/yoga and run it as go tool yoga …. See Packaging.