Gx types the full loop of a web page: the template, the route, the link, the action, the form and the signal in the browser. A renamed field stops the build. It does not give a 404 at run time.
Quick start
Make an app, run it and change a page in five minutes.
Tutorial
Build a small shop: pages, an action, a form and a registry component.
Guides
One page for each feature.
Reference
The command, the gx package, the grammar and each diagnostic.
Components
The registry, with live examples and the code of each one.
Comparisons
What templ, gomponents, Next.js and Rails do better, and what Gx does better.
What you get
- Typed templates. A
.gxfile is HTML with Go expressions. Props have names and types. - Typed routes and links. A route is a Go struct. A link is a value of that struct.
- Typed actions and forms. An action answers with typed patches. A form has one rule set for the browser and the server.
- No node. The
gxcommand and the Go toolchain run each default workflow. - One binary.
gx buildputs the pages, the scripts and the stylesheet in one file. - Components that you own.
gx addcopies a component into the app, andgx updatemerges a later release. - Islands. A TypeScript file is a component with typed props from Go, for the part of a page that needs client code.
- Widgets. A component of your app is a custom element on a page of a different site. Your server renders it. Read Widgets.
- Tools for agents. An action with
.Tool()is a tool that the agent of a user calls, in the browser and over MCP. Read Actions as tools for agents. - Plugins. A typed Go value adds directives, commands and build steps to the
gxcommand of a project. Read Plugins. - Automatic updates.
c.Updatesends only the fragments that changed. An optimistic directive shows a change before the server answers. - A JSON wire. An action with
.API()answers JSON.gx apiwrites an OpenAPI file and a TypeScript client. - Shared signals. Each viewer of a room sees the value of a shared signal.
- Checks with no test to write.
gx checkfinds content model defects, pages over their budget and dead code.gx fuzzrenders each component with random props. - Email. The registry item
emailandgx.RenderEmailmake an HTML email and its plain text from a component.