gsx — HTML as a first-class Go value

1 min read Original article ↗

gsxType-safe HTML that's actually pleasant to write

JSX-style markup, compiled to plain Go.

gsx

Type-safe by construction

Components lower to plain Go the compiler checks. Props are generated structs — gsx owns the field names, so there is no symbol-resolver guesswork.

Close to HTML, close to Go

JSX-style markup for templates; ordinary Go for everything else. Capitalization decides component-vs-element.

templ-compatible

gsx.Node has the identical method set to templ.Component, so gsx output drops into the templ ecosystem without importing templ.