HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
a-h
templ
Go2023–2026
a-h / templ

templ

A language for writing HTML user interfaces in Go.

11Distinct people
12Mentions
0Explicit recommenders
10.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A language for writing HTML user interfaces in Go.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year12 dated mentions

Observed mentions: 2023-09-27 17:12:07 UTC to 2026-07-26 17:16:14 UTC.

0123452023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC514
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC505
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

12 sources
Templ tries to stay simple, but it sacrificies ergonomics for simplicity and verbosity. Over the years, there are many proposals: inline elements, HTML tags, error hoisting. It's hard to retrofit into it. Beside the above, I also tried solving the all the ergonomics problem I saw when using templ. E.g. auto class merging, easy javascript interpolation within attributes. Auto json interpolation etc References: - HTML-style component authoring: https://github.com/a-h/templ/issues/663 and https://github.com/a-h/templ/issues/1181 - Inline/anonymous templ functions: https://github.com/a-h/templ/issues/1150 - Passing Go data to JS: https://github.com/a-h/templ/issues/944 and https://github.com/a-h/templ/issues/838 - JSON helpers for frontend data: https://github.com/a-h/templ/issues/739 - Deprecating script-tag Go interpolation due parser compl
Read the rest
exity: https://github.com/a-h/templ/issues/1408 - CSS/class ergonomics: https://github.com/a-h/templ/issues/61 - Duplicate class behavior: https://github.com/a-h/templ/issues/902 - Conditional attributes / else-if: https://github.com/a-h/templ/issues/933 - Dev mode/watch ergonomics: https://github.com/a-h/templ/issues/318 - Dynamic HTML element helper: https://github.com/a-h/templ/issues/1113
In Gsx: JSX-Like Template for Go
So they got tired of the rate of change from 2 dependencies: Wouter and TanStackQuery, so they changed their app architecture and now they have new dependencies: HTMX and Templ. HTMX v0 to v2 in 5 years: https://www.npmjs.com/package/htmx.org?activeTab=versions Enough of a breaking change that they have a v1 to v2 migration guide: https://htmx.org/migration-guide-htmx-1/ Templ is still on v0 with no breaking changes yet, but lots of minor and patch releases: https://pkg.go.dev/github.com/a-h/templ?tab=versions To compare with the original packages they were complaining about: Wouter. v1 to v3 over 6 years https://www.npmjs.com/package/wouter?activeTab=versions TanStack/react-query: as npm package: 'react-query': v0 to v3 over 5 years as npm package: '@tanstack/react-query': v4 to v5 over 2 years https://www.npmjs.com/package/react-query?a
Read the rest
In Dependency management fatigue, or why I ditched React for Go+HTMX+Templ
It was a great experience, at least to the extent I needed it. What sold me on it is its support for template composition[1], something I've struggled with using the standard `html/template`. And I really like the idea of generating statically typed templates which are just Go functions in the end of the day. In theory, I can share them between many of my apps, especially as I'm using a monorepo for all my projects. This is yet to be tested though. There are some rough edges around using `script` templates[2], for example it doesn't allow you to pass `this` and `arguments` from HTML event handlers[3]. This is not a show-stopper though, because you can always fall back to just defining your event handler in an HTML <script></script> block, albeit without type checking of the arguments and deduping the scripts. Also it hurts Locality of Beh
Read the rest
aviour which I'm a fan of. That being said, I think it has some great potential. I can completely imagine people building fully-fledged UI libraries in this once component reusability is improved. But the best part of using templ for me was that I could completely get rid of Node and NPM from my stack. How was your experience? [1]: https://templ.guide/syntax-and-usage/template-composition [2]: https://templ.guide/syntax-and-usage/script-templates#script... [3]: https://github.com/a-h/templ/issues/494
In Show HN: CPU Prices on eBay
Cool project and if it works for you and you're happy, that's all what counts. When I read the article, I was thinking that Go templates were used wrong. I was thinking there must be a way to define the template so you inject the content and don't need to define the start and the end of the html, but instead yield a block of other html as some kind of argument. I was trying to look it up, but couldn't find documentation on this. Maybe the author is right and I'm wrong. And I was wondering why the author isn't using something like Templ [0], which is kind of JSX with Go as hosting language. Probably because it needs the preprocessor / compile step? [0] https://github.com/a-h/templ
In LuaX: A Lua Dialect with JSX

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.