mygo-breeze-ui

module
v0.17.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT

README

Breeze UI for MyGo

CI Go Reference License GitHub stars

Website · English · 简体中文

Breeze UI draws MyGo's native UI widgets as the desktop the app runs on draws its own: macOS's controls on a Mac, Windows 11's on Windows and GNOME's libadwaita controls on Linux. The widgets have the names and signatures of MyGo's package ui, so a view swaps ui.Button for breeze.Button and keeps everything else.

The same view drawn as macOS, Windows 11 and GNOME

What is included

  • ui/breeze: widgets drawn as each platform draws its controls, following macOS 27, WinUI 3 and libadwaita 1.10 (GNOME 51), with sizes and colors measured from AppKit's and libadwaita's own rendering and taken from WinUI 3's theme resources, and a few of package ui's widgets under the same names in the platform's theme. The website's catalog lists every widget, the storybook shows each one, and docs/widgets describes them group by group.
  • Themes of the three platforms, light and dark, that follow the accent color, contrast and text size the user chose.
  • breeze-ui, a CLI that lists the widgets and platforms and writes snippets.
  • breeze-ui-mcp, a read-only MCP server over the same catalog.

Go package

go get github.com/yldm-tech/mygo-breeze-ui
import (
    "github.com/egoist/mygo/ui"
    breeze "github.com/yldm-tech/mygo-breeze-ui/ui/breeze"
)

func (app *settings) view(c *ui.Context) {
    breeze.Use(c) // the platform's colors and metrics
    ui.Column(c).Padding(16).Gap(12).Children(func() {
        breeze.Checkbox(c, &app.remember, "Remember me")
        breeze.Switch(c, &app.sync).Label("Sync")
        ui.Row(c).Gap(8).Children(func() {
            breeze.Button(c, "Cancel")
            if breeze.PrimaryButton(c, "Save").Clicked() {
                app.save()
            }
        })
    })
}

The platform is the system's unless breeze.SetPlatform picks another; breeze.Preview(c, p, body) draws part of a window as another platform, as the gallery does:

go run ./examples/breeze-ui

The pointer, the keyboard, the focus and accessibility come from MyGo's widget bases (ui.ButtonBase, ui.CheckboxBase, ui.SwitchBase). docs/widgets lists, group by group, what each widget looks like on each platform, where the values come from, and the current limits; docs/breeze-ui.md has what the widgets share.

Storybook

Every widget, on every platform, light and dark, with controls that change its arguments and the Go that builds it: the storybook runs in the browser, compiled to WebAssembly, and the same program opens as a window:

go run ./examples/storybook

CLI

npx --yes --package breeze-ui-cli breeze-ui list
npx --yes --package breeze-ui-cli breeze-ui add Switch -o ui/switch_snippet.go

Or install the Go command:

go install github.com/yldm-tech/mygo-breeze-ui/cmd/breeze-ui@latest

or download it for Linux, macOS or Windows from the releases. breeze-ui version prints the version it was built as.

MCP server

bun install
bun run build

The breeze-ui-mcp package exposes read-only tools to search components, list the platforms and generate snippets.

Development

go test ./...
go run ./examples/breeze-ui
BREEZE_SCREENSHOTS=/tmp/shots go test ./ui/breeze -run TestScreenshots   # write each platform's controls as PNG
bun install
bun run test
bun run typecheck
bun run build

Pull request titles and commit messages are Conventional Commits (feat(breeze): ..., fix: ...); the Labels workflow checks titles and labels each pull request by type, size, area and platform, and the Conflicts workflow labels those that conflict with their base branch. Once CI passes on main, the Release workflow releases it when the commits since the last tag call for a new version: it writes the version into the npm packages and the MCP server, commits that to main as chore(release), tags the commit and publishes a GitHub release with the breeze-ui command built for Linux, macOS and Windows. For the version, feat bumps the minor one, fix, perf and revert the patch one, a breaking change (feat!: or a BREAKING CHANGE: footer) the major one, or the minor one while the version is 0.x. Run the Release workflow by hand to force a bump.

Star History

Star History Chart

License

MIT

Directories

Path Synopsis
cmd
breeze-ui command
Command breeze-ui discovers Breeze UI for MyGo: its components, the platforms they follow, and snippets that use them.
Command breeze-ui discovers Breeze UI for MyGo: its components, the platforms they follow, and snippets that use them.
examples
breeze-ui command
Command breeze-ui is the Breeze UI gallery: the same view drawn with the controls of macOS, Windows 11 and GNOME side by side, or with the controls of the system it runs on.
Command breeze-ui is the Breeze UI gallery: the same view drawn with the controls of macOS, Windows 11 and GNOME side by side, or with the controls of the system it runs on.
storybook command
Command storybook shows every Breeze UI widget as Storybook shows components: stories in a sidebar, each drawn on a canvas as macOS, Windows 11 or GNOME draws it, or as all three side by side, light or dark, with controls that change its arguments and the Go that builds it.
Command storybook shows every Breeze UI widget as Storybook shows components: stories in a sidebar, each drawn on a canvas as macOS, Windows 11 or GNOME draws it, or as all three side by side, light or dark, with controls that change its arguments and the Go that builds it.
ui
breeze
Package breeze draws MyGo's native UI widgets as the desktop the app runs on draws its own: macOS's controls on a Mac, Windows 11's on Windows and GNOME's libadwaita controls on Linux.
Package breeze draws MyGo's native UI widgets as the desktop the app runs on draws its own: macOS's controls on a Mac, Windows 11's on Windows and GNOME's libadwaita controls on Linux.

Jump to

Keyboard shortcuts

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