Build beautiful WebAssembly apps in Go, swiftly and declaratively.
SwiftlyGo is a minimalist UI framework inspired by SwiftUI, powered by Go and WebAssembly. It provides a declarative way to build interactive web applications using idiomatic Go code.
No HTML, no CSS, no JavaScript. Just Go.
- ✅ Declarative UI composition
- 🔁 Reactive state with Observables
- 🧱 Composable widgets:
Label,TextField,Button - 🎯 Fluent modifiers:
.Padding(),.Background(),.Center() - 📦 Single binary output (WASM)
- 🔄 Hot reload dev server with live-rebuild
- 🔧 Zero-config startup
git clone https://github.com/yourname/swiftlygo
cd swiftlygo
go run ./cmd/coredevMake sure you have Go 1.21+ with WebAssembly support.
package main
import (
"fmt"
"gocore/core"
"gocore/ui"
)
func OneWay() {
source := core.NewObservable("")
in := ui.NewTextField()
in.BindTo(source)
out := ui.NewTextField()
btn := ui.NewButton("Copy")
btn.OnClick(func() {
fmt.Println("Clicked:", source.Get())
out.SetText(source.Get())
})
w := ui.NewWindow()
w.Add(in, out, btn)
w.Run()
}- Fluent styling modifiers
- Observables and bindings
- Derived computed observables
- Layout containers (e.g., VBox, HBox)
- Router & navigation
- Component lifecycle hooks
- Minimal CSS-in-Go system
Created by @serge-hulne
Inspired by SwiftUI, Svelte, and the simplicity of Go.
GPL-3.0