// the find
a-h/templ
A language for writing HTML user interfaces in Go.
templ is a compiled templating language for Go that generates type-safe HTML rendering functions. You write `.templ` files, run the code generator, and get Go functions — no interface{} juggling, no runtime template parsing. It's aimed at Go developers doing server-side rendering who want their templates to participate in the type system rather than fight it.
The LSP and IDE integration is a first-class citizen, not an afterthought — you get autocompletion and diagnostics inside `.templ` files without leaving your editor. Generated output is plain Go functions, so the compiler catches broken component calls at build time, not when a user hits that page. The hot-reload proxy (SSE-based, baked into `templ generate --watch`) works without any external tooling. XSS protection is structural: string values are escaped by default and you have to explicitly opt into raw HTML, so injection is hard to introduce accidentally.
The code-generation step is a real friction point in CI and team workflows — you must commit the generated `_templ.go` files or add a generate step everywhere, and a mismatch between templ version and generated files silently produces wrong output until you re-run generate. The syntax is its own language that looks like Go but isn't, which means a new hire needs to learn both; unlike `html/template` it's not something you can pick up from the stdlib docs. Component composition is purely function-call based — there's no slot or named-outlet mechanism beyond passing `templ.Component` as a parameter, which gets awkward for complex layout hierarchies. No server-side state or reactivity story: if you want anything beyond static SSR + HTMX patches you're wiring that entirely yourself.