NSGo
English | 简体中文
A cross-platform native UI engine with a Go backend: app logic, the reactive graph and layout run in Go, and each platform draws with its own native UI.
It follows the design of Native Shell (NSH), for teams that want NSH's model without writing Rust.
Status
NSGo is early, with no release or stable API yet. It runs on macOS, iOS and its App Clips, tvOS, watchOS, Windows, Linux, the web, Android and WeChat, QQ, Alipay and Douyin mini programs, and apps embed in iOS, Android and Go desktop apps of their own; ARCHITECTURE.md tracks each target.
Getting started
With Go 1.26 or later, and Xcode for iOS, tvOS and watchOS, create an app and run it with hot reload:
go mod init example.com/hello
go get github.com/oneo-me/nsgo
go get -tool github.com/oneo-me/nsgo/cmd/nsgo
go tool nsgo init # -template tsx for a TSX app
go tool nsgo dev # -target web, ios_simulator, tvos_simulator, watchos_simulator, android or miniprogram_wechat to run elsewhereAn app is Go components that return elements, with signals updating what reads them:
func Root(cx *core.Scope) core.Node {
count := core.NewSignal(cx, 0)
return core.View{Style: core.Style{Padding: core.All(24), Gap: 12}, Children: []core.Node{
core.Text{ContentFunc: func() string { return fmt.Sprintf("Pressed %d times", count.Get()) }},
base.Button{
OnPress: func(core.PressEvent) { count.Update(func(n int) int { return n + 1 }) },
Children: []core.Node{core.Text{Content: "Press me"}},
},
}}
}
func main() { nsgo.Run(Root) }Documentation
The docs cover components and state, layout, styles, navigation, a component reference, TSX apps, localization, testing, embedding, building and shipping; the live demo runs the gallery in the browser.
Development
go tool nsgo dev examples/gallery # run the gallery
go tool nsgo check # vet every package
go tool nsgo test # every package's testsContributing has the rest of the setup. Read ARCHITECTURE.md and AGENTS.md before changing code, and CHANGELOG.md for what changed.
License
Licensed under the Apache License, Version 2.0. NSGo is a port of NSH, and NOTICE records the attribution that port owes.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in NSGo by you, as defined in the Apache-2.0 license, shall be licensed under Apache-2.0, without any additional terms or conditions.