Skip to content

gsxhq/gsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,277 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gsx

A templating language for Go: templ-style component declarations with a JSX-style markup body, compiled to plain Go.

Status — alpha. gsx is usable end to end, but the language and APIs may change before a stable release. 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 authored Go signature; markup binds parameters by exact name and direct Go callers use the same function.
  • Close to HTML and to Go — JSX-style markup for templates; ordinary Go for everything else. Tags resolve against package symbols; an unresolved lowercase tag remains an HTML element.
  • templ-compatiblegsx.Node has the identical method set to templ.Component, so gsx output drops into the templ ecosystem without importing templ. The runtime is standard-library only.

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