Show HN: Proton a Pure go, no CGO GUI library for building applications

CzaxTanmay1 pts0 comments

Proton — GUI for Go

v1.0 — Pure Go, no C deps

GUI for Go.<br>Finally.

Proton is a desktop GUI library that doesn't make you write XML,<br>install CGo toolchains, or question your career choices.<br>Pure Go. Built on Gio.

Download for your OS

View on GitHub

Detecting your OS...

main.go

1package main

3import "github.com/CzaxStudio/proton"

5type UI struct {

6 name proton.Editor

7 btn proton.Clickable

8}

10func main() {

11 u := &UI{}

12 a := proton.New("my app")

13 a.ApplyPalette(proton.NordPalette)

14 a.Window("Hello", 480, 300, func(win *proton.Win) {

15 proton.H3(win, "Hello from Proton!")

16 proton.Gap(win, 8)

17 proton.Input(win, &u.name, "Your name")

18 proton.Gap(win, 8)

19 if proton.Button(win, &u.btn, "Go") {

20 println("Hello,", u.name.Text())

21 }

22 })

23 a.Run()

24}

INSTALL<br>go get github.com/CzaxStudio/proton<br>Copy

Why Proton

Built for Go developers<br>who value their time

No CGo. No XML. No component lifecycles. Just Go functions that draw things on screen.

Pure Go

No C dependencies. No CGo toolchain. Works with a vanilla go build on every platform.

Cross-platform

Linux, macOS, and Windows. One codebase, three platforms. The dream is real.

Immediate mode

Your draw function runs every frame. No state syncing, no virtual DOM, no diffing algorithm to debug at 2am.

Simple theming

Four colors. One function call. Built-in palettes for Nord, Catppuccin, Rose Pine, and more.

One import

State types re-exported. Layout helpers included. You only ever need to import proton.

Real layouts

Row, Column, Split, Grid, GrowRow. Everything you need to build a real UI without fighting the framework.

How it works

Three steps to a running app

No boilerplate ceremony. No project scaffolding. Just code.

01

Define your state

Put all widget state in a plain Go struct. One proton.Clickable per button, one proton.Editor per text field. No special types, no reactive wrappers.

02

Write your draw function

Call widget functions in order — they appear on screen in that order, stacked vertically by default. Use Row, Split, and Pad to arrange them differently.

03

Call a.Run()

That's it. The event loop runs, your draw function fires every frame, and Gio handles rendering, input, and OS integration. You handle the logic.

Widget library

Everything you need.<br>Nothing you don't.

28 widgets covering every common UI pattern. Stateful ones return values — no callbacks, no event handlers.

Label<br>Body text

H1 – H6<br>Heading sizes

Text<br>Custom size, color, weight

Caption<br>Small annotation text

Button<br>Filled — returns bool

OutlineButton<br>Ghost style — returns bool

IconButton<br>Icon only — returns bool

Tappable<br>Any content as clickable

Input<br>Single-line text field

TextArea<br>Multi-line text field

Checkbox<br>Returns true on change

Toggle<br>On/off switch

RadioButton<br>Shared Enum state

Slider<br>Returns 0.0 – 1.0

ProgressBar<br>0.0 – 1.0 fill

List<br>Virtual scrolling list

HList<br>Horizontal list

Scroll<br>Scrollable area

Divider<br>Horizontal rule

Rect<br>Filled rectangle

RoundRect<br>Rounded rectangle

Card<br>Content in a background box

Badge<br>Colored chip / tag

Image<br>PNG and JPEG

Tooltip<br>Hover label

Toast<br>Timed notification

MinSize<br>Minimum size constraint

MaxWidth<br>Maximum width constraint

Theming

Four colors.<br>One function call.

Built-in palettes or roll your own. The entire app updates at once — no hunting through component stylesheets.

DarkPalette

NordPalette

RosePinePalette

CatppuccinPalette

Custom (Hacker)

Download

Get Proton

Free. Open source. MIT license.

Windows

x86 / x64

macOS

Intel

Linux

amd64

Download for my OS

Detecting...

Or install via Go

go get github.com/CzaxStudio/proton

Linux also needs: apt install libwayland-dev libxkbcommon-dev libvulkan-dev

proton text function state returns pure

Related Articles