NewThe code editor is now its own module

One Go codebase.
Desktop and web.

Yoga is a from-scratch UI framework in Go. It draws with WebGPU, natively on the desktop and from WebAssembly in the browser, and lays out with a pure-Go flex, grid and stack engine.

macOS, Linux & Windows The browser, via WASM No browser engine on the desktop Open source, MIT
Yoga's component catalog in the yoga-dark theme: a sidebar of widget categories, borders, cards, alerts and badges

25 themes in the box, every one checked against WCAG 2.1 AA

yoga-darkyoga-lightyoga-midnightyoga-high-contrastyoga-colorblind-darkgithub-darkgithub-lightcatppuccincatppuccin-lattedraculanordsolarized-darksolarized-lightgruvbox-darkgruvbox-lightmonokaitokyo-nighttokyo-night-dayone-darkone-lighteverforest-darkeverforest-lightyoga-darkyoga-lightyoga-midnightyoga-high-contrastyoga-colorblind-darkgithub-darkgithub-lightcatppuccincatppuccin-lattedraculanordsolarized-darksolarized-lightgruvbox-darkgruvbox-lightmonokaitokyo-nighttokyo-night-dayone-darkone-lighteverforest-darkeverforest-light
The model

Your state in a struct.
Your UI, rebuilt every frame.

An app is a Go struct with one method, Body(c *ui.Ctx) ui.View. Yoga calls it on every drawn frame and lays out what it returns, so the screen always matches your data.

01

Plain Go state

Durable state lives on your app struct. Hover, caret, scroll and open menus live in the framework, keyed by a stable id.

02

Idle means idle

The event loop sleeps until input or an animation request, so an idle window costs close to no CPU.

03

One tree, three hosts

The same Body runs in a desktop window, in the browser, and headless in your tests.

04

Controlled widgets

Pass the value in, take changes back in a callback. No two-way binding to reason about.

Hello, Yoga

A window is a dozen lines.

type App struct{ name string }

func (a *App) Body(c *ui.Ctx) ui.View {
	th := c.Theme()
	return ui.Column(
		ui.Title("Hello"),
		ui.TextField("name", a.name).
			Placeholder("Your name").
			OnChange(func(s string) { a.name = s }).
			DefaultFocus(),
		ui.Button("ok", ui.Text("OK")).Primary().OnClick(a.save),
	).Gap(th.Spacing.M).Padding(th.Spacing.L).Grow(1).Background(ui.TokenSurface)
}

func main() {
	yoga.Run(yoga.Config{Title: "Hello", Width: 640, Height: 480},
		func() *App { return &App{} })
}

Walk through it

The framework

Everything an app needs,
drawn by Yoga.

Layout, widgets, overlays, themes and icons, written in Go above a thin platform host. Nothing is handed to a browser engine or to native widgets.

Widgets that keep up

Stateless DSL nodes for the simple parts, retained widgets for the ones that keep real state: tables with editable cells, trees, file trees and virtualized lists.

ButtonTextFieldTextAreaCheckboxRadioSwitchSelectSliderSegmentedTabsNavSplitterDrawerDialogToastMenuCommand paletteTableTreeFileTreeListViewFormFile dialogMarkdownTooltipPopoverCardBadgeProgressSpinner

WebGPU everywhere

GLFW and wgpu-native on the desktop, the browser's WebGPU from WebAssembly. Everything above the host is pure Go.

0browser engines on the desktop

Flex, grid and stack

Column, Row, Grid, Stack and Scroll, with gap, padding, grow, align and floating corners.

Text fields that help

Highlight ranges of a field's value, offer completions under it, and explain what the pointer rests on.

Custom title bars

Put menus and search in the title bar. macOS keeps its traffic lights; Windows and Linux get drawn controls.

Command palette & shortcuts

Register commands with key chords, including two-chord sequences, and get a fuzzy palette for free.

Yoga's command palette listing recent files and commands

Forms and dialogs

Settings rows with switches, selects, numbers and file pickers; info, danger and input dialogs; toasts; a pure-Go file dialog.

Yoga's form rows: a switch, a select, number and text fields, a file picker, a slider and a stepper

Accessible themes

Contrast is tested, high-contrast and colorblind-safe palettes ship, and FromPalette builds a passing theme from your brand colors.

Lucide icons

Pre-rasterized Lucide symbols, dropped by the linker when unused, plus your own SVGs.

A code editor, if you want one

yogaui/editor adds Tree-sitter highlighting, language servers, folding and multiple cursors.

Built with Yoga

Real apps, not demos.

Yoga is the UI of two shipping desktop apps, and the framework grows with what they need.

Hm

A native code editor with an AI coding agent built in: file tree, tabs, a terminal, git, language servers and a chat pane, all drawn by Yoga.

  • Every editor pane is a yogaui/editor Editor.
  • Settings are Yoga forms; the command palette is Yoga's.

usehm.dev

Chapar

An API client for HTTP, gRPC and WebSockets: request trees, environments, editable tables of headers and variables, and response viewers.

  • Template variables are highlighted, completed and explained in Yoga text fields.
  • Packaged for macOS, Linux and Windows with the yoga CLI.

chapar.rest

Ship it

One CLI for every platform.

The yoga tool builds and packages your app, configured by an optional yoga.toml.

  • macOS: a signed .app, DMG or PKG, universal binaries, notarization.
  • Linux: tar.gz or tar.xz, plus an AppImage when appimagetool is installed.
  • Windows: a portable zip with an icon, DPI manifest and version info.
  • The web: a static folder you can host anywhere.

Packaging docs

terminal
# Desktop: .app + DMG, AppImage, a Windows zip
yoga package -os darwin -arch universal -notarize ./cmd/app
yoga package -os linux ./cmd/app
yoga package -os windows ./cmd/app

# The browser: index.html, app.wasm and a loader
yoga package -os web ./cmd/app
yoga serve                      # serves ./dist/web

# CI: same UI pipeline, no window or GPU
go test -tags nogpu ./...

Build something native.

Go 1.26 or newer. Desktop builds need Cgo; the browser and headless builds do not.

$go get github.com/yogaui/yoga
esc