Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

NSGo

NSGo

English | 简体中文

GitHub Blog X 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 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 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.

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.

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
androidapp-clipsapple-tvcross-platformdesktopflexboxgoioslinuxmacosminiprogramnativenshreactivetvosui-frameworkwatchoswebassemblywechat-miniprogramwindows

语言 Languages

Go92.4%
Java4.9%
JavaScript1.1%
Astro0.4%
CSS0.3%
TypeScript0.3%
Swift0.3%
HTML0.1%
Shell0.1%
Assembly0.0%
PowerShell0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
349
Total Commits
峰值: 165次/周
Less
More

核心贡献者 Contributors