Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,307 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gsx

A JSX-like templating language for Go, compiled to plain Go that streams HTML.

Status — alpha. gsx is used in production today, while language and API compatibility may change before 1.0. See Status and Roadmap.

What is gsx

.gsx files hold ordinary Go (imports, types, funcs) plus component declarations. A generator lowers each component to plain Go in a .x.go file the Go compiler type-checks and builds:

.gsx → parser → AST → codegen → .x.go → go build → HTML
  • Checked by Go — each component keeps its exact authored Go signature, and markup binds parameters by name.
  • HTML-shaped markup with ordinary Go — use JSX-like markup for templates and ordinary Go for everything else.
  • Safe by context — contextual HTML, URL, CSS, and JavaScript escaping with a standard-library-only runtime.
  • Go-native tooling — generation and builds are Go; Node.js is needed only when your application chooses frontend tooling such as Vite.

A taste

import "github.com/gsxhq/gsx"

// Markup can bind to a package-level var — inferred as gsx.Node.
var footer = <><hr/><small>Built with gsx</small></>

component Card(title string, featured bool, children gsx.Node) {
	<section class={ "card", "card-featured": featured }>
		<h2>{title}</h2>
		{ if featured { <span class="badge">Featured</span> } }
		<div class="body">{children}</div>
		{footer}
	</section>
}

Run gsx generate to compile this to plain Go (.x.go), then go build.

Learn more

Documentation site

The public docs site — https://gsxhq.github.io/ — is built with VitePress in the separate gsxhq.github.io repo, which renders the Markdown in docs/guide/.

Contributing

Issues and discussion welcome. Runtime code must stay standard-library only; the generator/CLI may use golang.org/x/tools.

License

MIT © 2026 Jackie Li

Releases

Packages

Contributors

Languages