Hey everyone!
If you've ever tried building a desktop application in Go, you probably know the drill. You either end up using Electron (and suddenly your simple utility app eats 500MB of RAM), or you try a native GUI framework only to get stuck in a nightmarish battle with CGO cross-compilation toolchains just to build a Windows binary from your Mac.
I got tired of the friction, so I built Protonโa pure Go, immediate-mode GUI library that doesn't make you want to switch back to web development.
What is Proton?
Proton is an ultra-lightweight, native GUI library built on top of Gio. It completely abstracts away complex underlying rendering types, giving you a clean, stacked immediate-mode API while preserving a 100% native Go experience.
Here is the best part: Zero CGO is required. You can cross-compile to Windows and macOS flawlessly from any machine without installing external compilers.
The Quick Start
Building a window with a header takes less than 15 lines of code:
package main
import "github.com/CzaxStudio/proton"
func main() {
a := proton.New("hello")
a.Window("Hello World", 400, 200, func(ctx proton.Context) {
proton.H3(ctx, "Hello from Proton!")
})
a.Run()
}
Key Features That Make Life Easier
API Immunity: Every draw function takes a proton.Context interface. Zero raw Gio types pollute your codebase. If the underlying rendering engine updates, your code remains completely untouched.
Immediate Mode Simplicity: No setState, no complex component trees, and absolutely no XML or HTML layout files. Your draw function runs every frame, stacking widgets vertically by default.
Batteries Included: It comes packed with text styles, buttons, inputs, layouts, and advanced components right out of the box.
Instant Theming: Includes 46 built-in palettes (like Nord, Dracula, Catppuccin, and Tokyo Night). You can change the entire look with a single line: a.ApplyPalette(proton.DraculaPalette). You can even use hex color codes or add a live runtime ThemePicker.
Cross-Platform: The exact same codebase runs flawlessly on desktop and even supports Android deployment.
Rich Widget & Layout Ecosystem
We've built out a robust toolkit so you don't have to reinvent the wheel:
Layouts: Row, Column, GrowRow, ResizeSplit, Grid, and flexible padding configurations.
Widgets: Custom inputs, text styles, sliders, check boxes, progress bars, and search inputs.
Data & Feedback: Component helpers like Table, ProgressRing, Stepper, and easy Toast overlays.
Utilities: Simple keyboard shortcut binding via proton.OnKey(ctx, proton.ModCtrl, "S", saveFunc).
I'd Love Your Feedback!
Proton is actively maintained and evolving fast. Whether you want to build a quick system utility, a lightweight developer dashboard, or a complex standalone tool, Proton is built to keep your binary small and your development speed fast.
Check out the repository, run the example kitchen sink app (go run ./examples/showcase), and let me know what you think!
Star the repo if you like it: Proton Repo
Read the documentation: Proton Docs
Website: Proton Website
Top comments (0)