jamb

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0

README

jamb

A declarative, GPU-accelerated desktop UI framework for Go. Tested only on Windows.

jamb is a small, declarative, GPU-rendered desktop UI framework written in plain Go. An app is a tree of elements built by components, and its state lives in signals, so a change re-renders only the parts that depend on it.

Status: jamb is pre-1.0. The API may change between versions. It runs on Windows 10 and 11 today; other platforms are planned.

Highlights

  • Widgets: buttons, text fields, checkboxes, switches, sliders, selects, comboboxes, date and time pickers, color pickers, menus, tabs, trees, data grids, forms with validation, toasts, and modal dialogs.
  • Layout: flexbox, grid, sidebars, split panes, docking, and variable-height and uniform lists.
  • Theming: light and dark themes that follow the system's light or dark mode, 37 converted predefined themes in 22 families, and automatic high contrast.
  • Accessibility: a UI Automation tree for screen readers, keyboard navigation, reduced motion, and a text size setting.
  • Text: shaping with HarfBuzz, fallback fonts, rich and selectable text, and input method (IME) composition.
  • Graphics: a canvas, SVG images, gradients, and charts.
  • Code editing: a codeedit package with tree-sitter highlighting, undo and redo, and find and replace.
  • OS integration: jump lists, single instance, a notification area icon, taskbar progress, and OS notifications.
  • Development tools: jamb dev rebuilds and restarts an app on each save, and a visual inspector shows the elements of a running window.
  • Packaging: jamb package builds a Windows zip, an installer, and an MSIX.

Install

jamb needs Windows 10 or 11 and Go 1.27.1 or later. Add it to a module with:

go get github.com/tyler-builds/jamb@v0.1.0

A minimal main.go opens a window with a greeting and a button that counts its clicks:

package main

import (
	"fmt"

	"github.com/tyler-builds/jamb/app"
	"github.com/tyler-builds/jamb/ui"
)

func main() {
	clicks := ui.NewSignal(0)

	app.New().Run(app.Window{
		Title:  "Hello",
		Width:  800,
		Height: 600,
		// Root is a component, so it runs again whenever clicks changes.
		Root: func(ctx *ui.Context) ui.Element {
			return ui.Div().Column().Center().Gap(24).
				Child(ui.Text("Hello, world!").FontSize(24)).
				Child(ui.Button(fmt.Sprintf("Clicked %d times", clicks.Get())).
					OnClick(func() { clicks.Update(func(n int) int { return n + 1 }) }))
		},
	})
}

The jamb command is a separate module, tagged cmd/jamb/v0.1.0 for the same release:

go install github.com/tyler-builds/jamb/cmd/jamb@v0.1.0

The repository includes three examples. From a clone of the repository, run them with:

go run ./examples/hello    # the smallest complete app: one window, a signal and a button
go run ./examples/demo     # a tour of the widgets, layouts, and pages
go run ./examples/notes    # a note-taking app

The getting started guide covers the commands for building and packaging, and the concepts page introduces the API.

Benchmarks

The same hello-world app (a window, a greeting and a click counter) built with jamb and with GPUI, the UI framework from Zed, on one Windows machine. Lower is better in every row, and the better figure is in bold. docs/comparison-gpui.md has the method, the ranges of each measurement and the setup.

Measure jamb GPUI
Startup to first frame, warm launch 266 ms 387 ms
Startup to first frame, first launch (scanned by the antivirus) 496 ms 611 ms
Idle CPU, window focused 0.29% of one core 1.85%
Idle CPU, window in the background 0.16% 1.67%
Memory, private bytes 78.2 MB 75.3 MB
Memory, working set 58.8 MB 52.5 MB
GPU memory, dedicated 13.8 MB 17.5 MB
Threads 36 30
CPU while the pointer moves over the window 2.2% 3.4%
CPU while the window is resized 11.5% 18.8%
Context switches per second while resizing 2,411 1,820
Build after an edit 2 s 4 s (release), 6 s (debug)
Clean build 9 s 138 s (release), 100 s (debug)
Binary size, default release build 8.4 MB 9.21 MB
Binary size, GPUI's size-optimized build profile (a clean build of about 238 s) 4.31 MB

The runtime and memory rows were measured on 2026-10-12, before the themes, the dock, the inspector, charts and the code editor were added; since then the hello app's binary has grown from 7.18 MB to 8.41 MB (measured on 2026-10-14), and memory and startup may have changed too. They will be measured again.

The demo app (four pages, about 200 elements on screen), from BENCHMARKS.md, measured on 2026-10-06 and 2026-10-12, also before those additions:

Measure Result What it means
Rebuild after an edit 0.25 to 0.84 s Edit, build and run stays under a second; jamb dev shows the new window 1.05 to 1.36 s after a save.
Startup to first frame about 195 ms About 180 ms of it is the graphics driver creating the Direct3D device.
Idle CPU 0 ms in 10 s An idle window draws nothing and wakes no timers.
Full re-render of every component about 0.3 ms of CPU per frame A 120 Hz display allows 8.3 ms per frame, so this is about 4% of the budget.
One signal change in a 10,000-element tree 0.59 ms Only the component that read the signal renders again.
One scroll step in a 100,000-row list 0.17 ms Only the rows in view are built.

How it works

jamb is plain Go, with no cgo. On Windows it uses Win32 for windows and input, and draws with a Direct3D 11 renderer that it reaches through COM vtables; text is shaped with HarfBuzz (through go-text) and the accessibility tree is exposed through UI Automation. Each frame, components whose signals changed render again, the layout updates what moved, and the renderer submits the scene to the GPU; nothing is drawn while nothing changes. docs/architecture.md has the details.

Examples

The examples are in examples/. examples/hello is the minimal app shown above. examples/demo is a tour of the widgets and layouts. It is also the app that jamb package builds in the packaging guide. examples/notes is a note-taking app with persistence, a command palette, and a keymap file. docs/examples.md describes the demo and notes apps.

Documentation

The full documentation is in docs/. Each page covers one topic:

Contributing

Development needs Go 1.27.1 or later and Windows. Run the headless tests with:

gofmt -l .
go vet ./... ./cmd/jamb/... ./examples/demo/... ./examples/notes/... ./examples/hello/...
go test ./... ./cmd/jamb/... ./examples/demo/... ./examples/notes/... ./examples/hello/...

gofmt -l . should print nothing. The go test runs need no display. A few tests open a window; set JAMB_LIVE_TESTS=1 to run them as well. The module layout, the packages, and the internals are in docs/architecture.md.

Changelog

Release notes are in CHANGELOG.md.

License

jamb is licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

An app built with jamb ships third-party code too. The list of notices to include with a distributed app is in Licenses of what your app ships.

Directories

Path Synopsis
Package access is jamb's platform-neutral accessibility model.
Package access is jamb's platform-neutral accessibility model.
accesstest
Package accesstest has helpers for tests that check an access tree: find a node by its role and name, and assert its role, name and states.
Package accesstest has helpers for tests that check an access tree: find a node by its role and name, and assert its role, name and states.
Package actions holds the actions of jamb's text fields and text areas: the commands their keys run, such as Undo, Copy and MoveWordLeft.
Package actions holds the actions of jamb's text fields and text areas: the commands their keys run, such as Undo, Copy and MoveWordLeft.
Package app runs a jamb application: it opens native windows, creates the GPU renderer and drives one ui runtime per window.
Package app runs a jamb application: it opens native windows, creates the GPU renderer and drives one ui runtime per window.
Package charts draws charts with ui.Canvas: line, area, bar (grouped and stacked, vertical and horizontal), scatter, pie and donut, radar, candlestick and Sankey charts.
Package charts draws charts with ui.Canvas: line, area, bar (grouped and stacked, vertical and horizontal), scatter, pie and donut, radar, candlestick and Sankey charts.
cmd
jamb module
Package codeedit is a code editor for jamb: a multi-line text area for source code, with a line-indexed text buffer, undo and redo, several selections, find and replace, folding by indentation, and syntax highlighting.
Package codeedit is a code editor for jamb: a multi-line text area for source code, with a line-indexed text buffer, undo and redo, several selections, find and replace, folding by indentation, and syntax highlighting.
highlight
Package highlight colors the text of a code editor with tree-sitter.
Package highlight colors the text of a code editor with tree-sitter.
internal/treesitter
Package treesitter runs tree-sitter language modules in WebAssembly with wazero.
Package treesitter runs tree-sitter language modules in WebAssembly with wazero.
Package dialog describes the native dialogs an app opens from a window: file open, file save, folder pick and message boxes.
Package dialog describes the native dialogs an app opens from a window: file open, file save, folder pick and message boxes.
Package ease has easing functions for animation.
Package ease has easing functions for animation.
Package icons provides a small set of line icons defined in Go on a 24×24 grid (2-unit strokes, round caps and joins — the familiar "Lucide" look) and a rasterizer that turns them into anti-aliased coverage masks.
Package icons provides a small set of line icons defined in Go on a 24×24 grid (2-unit strokes, round caps and joins — the familiar "Lucide" look) and a rasterizer that turns them into anti-aliased coverage masks.
Package input defines the platform-neutral input vocabulary shared by the platform adapters and the ui package: keys, mouse buttons, modifiers and cursor shapes.
Package input defines the platform-neutral input vocabulary shared by the platform adapters and the ui package: keys, mouse buttons, modifiers and cursor shapes.
internal
iconsheet command
Command iconsheet renders every built-in icon to a PNG contact sheet:
Command iconsheet renders every built-in icon to a PNG contact sheet:
inspect
Package inspect is the data of the visual inspector (see app/inspect.go): what it shows about an element of an inspected window, and the frame timings of the window.
Package inspect is the data of the visual inspector (see app/inspect.go): what it shows about an element of an inspected window, and the frame timings of the window.
layout
Package layout is a small flexbox-style layout engine.
Package layout is a small flexbox-style layout engine.
notifyscheme
Package notifyscheme derives the URI scheme that a click on a jamb app's notification starts the app with.
Package notifyscheme derives the URI scheme that a click on a jamb app's notification starts the app with.
platform
Package platform defines the framework-owned contract between the cross-platform core and an operating-system adapter.
Package platform defines the framework-owned contract between the cross-platform core and an operating-system adapter.
platform/darwin
Package darwin will hold the macOS (Cocoa + Metal) adapter.
Package darwin will hold the macOS (Cocoa + Metal) adapter.
platform/linux
Package linux will hold the Linux (Wayland/X11 + Vulkan or GL) adapter.
Package linux will hold the Linux (Wayland/X11 + Vulkan or GL) adapter.
platform/windows
Package windows is the Win32 platform adapter.
Package windows is the Win32 platform adapter.
render
Package render defines the framework-owned renderer contract.
Package render defines the framework-owned renderer contract.
render/d3d11
Package d3d11 is the Direct3D 11 backend for render.Renderer.
Package d3d11 is the Direct3D 11 backend for render.Renderer.
rope
Package rope implements a persistent rope for UTF-8 text, the text buffer behind a code editor.
Package rope implements a persistent rope for UTF-8 text, the text buffer behind a code editor.
scene
Package scene holds the small set of GPU-friendly primitives the ui package paints into and a renderer draws from.
Package scene holds the small set of GPU-friendly primitives the ui package paints into and a renderer draws from.
svg
Package svg draws static SVG images with internal/vector: shapes, paths, groups and use, transforms, fills and strokes with colors and linear and radial gradients, opacity, clip paths, and the presentation attributes, style attributes and simple style sheets that design tools write.
Package svg draws static SVG images with internal/vector: shapes, paths, groups and use, transforms, fills and strokes with colors and linear and radial gradients, opacity, clip paths, and the presentation attributes, style attributes and simple style sheets that design tools write.
text
Package text loads fonts, lays out and measures text, and rasterizes glyphs (and other coverage masks such as icons) into a shared atlas.
Package text loads fonts, lays out and measures text, and rasterizes glyphs (and other coverage masks such as icons) into a shared atlas.
themegen command
Command themegen converts the predefined themes of gpui-component into jamb themes.
Command themegen converts the predefined themes of gpui-component into jamb themes.
uihost
Package uihost connects the app package to the methods of ui.Runtime that only a window host calls: the wake-up function, platform services, the cursor, window focus and the window areas of a custom title bar.
Package uihost connects the app package to the methods of ui.Runtime that only a window host calls: the wake-up function, platform services, the cursor, window focus and the window areas of a custom title bar.
vector
Package vector draws paths into pixels on the CPU: fills with the nonzero or even-odd rule, strokes with joins, caps and dashes, solid colors and linear and radial gradients, clipping and group opacity.
Package vector draws paths into pixels on the CPU: fills with the nonzero or even-odd rule, strokes with joins, caps and dashes, solid colors and linear and radial gradients, clipping and group opacity.
watch
Package watch reports changes to the files in a directory.
Package watch reports changes to the files in a directory.
win32
Package win32 is a minimal, cgo-free binding to the Win32 calls the Windows adapter needs.
Package win32 is a minimal, cgo-free binding to the Win32 calls the Windows adapter needs.
Package keymap sets key bindings from JSON files, so users can change shortcuts without code.
Package keymap sets key bindings from JSON files, so users can change shortcuts without code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL