Skip to content
nsgo-devPublic

About

A cross-platform native UI engine with a Go backend: write apps in Go with signals, memos and flexbox layout, and each platform draws with its own native views — iOS and its App Clips, tvOS, watchOS, macOS, Windows, Android, Linux, the web and WeChat, QQ, Alipay and Douyin mini programs

Topics

Resources

Security policy

Stars

457 stars

Watchers

3 watching

Forks

Latest commit

 

History

844 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSGo

NSGo

English | 简体中文

GitHub Blog X Telegram GitHub Sponsors

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.

The gallery's Stocks demo on macOS The gallery's component list on a phone

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 experimentally in WeChat, QQ, Alipay and Douyin mini programs, which hold an app to 2 MB, and apps embed in iOS, Android and Go desktop apps of their own; ARCHITECTURE.md tracks each target.

Getting started

With Go 1.27.3 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/nsgo-dev/nsgo
go get -tool github.com/nsgo-dev/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 elsewhere

An 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.

Coding agents learn NSGo from its skill, bunx skills add nsgo-dev/nsgo, and read the docs as Markdown from llms.txt.

Development

go tool nsgo dev examples/gallery   # run the gallery
go tool nsgo check                  # vet every package
go tool nsgo test                   # every package's tests

Contributing has the rest of the setup. Read ARCHITECTURE.md and AGENTS.md before changing code, and CHANGELOG.md for what changed.

Community

Questions, ideas and what you build with NSGo are welcome in nsgo-dev-community, the Telegram group @nsgo_dev. Report bugs and propose changes in issues.

The QR code of the Telegram group @nsgo_dev

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.

About

A cross-platform native UI engine with a Go backend: write apps in Go with signals, memos and flexbox layout, and each platform draws with its own native views — iOS and its App Clips, tvOS, watchOS, macOS, Windows, Android, Linux, the web and WeChat, QQ, Alipay and Douyin mini programs

Topics

Resources

Security policy

Stars

457 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages