Build complete UIs from Go —
without the frontend stack.
123 server-rendered components for templ, HTMX, and Tailwind v4. Every button, card, and accordion on this page is rendered by the library it sells — view source and look for the framework.
Every Go web app pays a frontend tax.
The moment a Go service needs a real UI, someone hands you a second stack. Recurring costs — recognize them?
Two toolchains for one product
Node modules, a bundler, framework upgrades, and a lockfile that drifts — maintained next to the Go service that actually holds your business logic.
Two languages for one feature
A form becomes an API handler, a client store, a schema, and a fetch layer. Every field exists four times, and each copy can rot independently.
UI debt you inherit by default
Focus traps, aria wiring, dark mode, CSP nonces: the details that make UI feel finished are exactly the ones unassisted SPA boilerplate leaves out.
Render the UI where the data already lives.
The library takes the unfinished details off your plate — typed, tested, and documented once, for every component.
Invalid states are compile errors
Typed string enums on every closed set — variant, size, tone, method. Pass an unknown value and the build fails before a browser ever opens.
Go is the whole pipeline
templ generate and go build. CSS comes from one Tailwind v4 entry file. No pnpm, no bundler config, no node_modules directory in your deploy artifact.
CSP-safe without ceremony
Inline scripts ship with nonces, no eval, no inline handlers. An integration suite renders every component and fails if a single script tag goes out naked.
Accessible and dark by default
Every component carries dark-mode variants and reduced-motion fallbacks — enforced by regression tests, not style-guide memos. Accessibility findings gate the build.
This page is the demo.
The stat cards below, the copy button, the FAQ accordion — all rendered by library components. No client framework loads anywhere on this page.
- Components
- 123
- SVG icons
- 105
- Typed enums
- 63
- Go modules
- 7
go get github.com/larsartmann/templ-components@latest
The questions you would ask in review.
Is it production-ready?
It is. The library is at v1 under semantic versioning, and every component ships behind three regression layers: HTML golden tests, pixel-level visual tests in headless Chromium, and an axe-core accessibility gate that fails the build on serious violations. This website — docs included — is rendered through the library itself.
Why not just write raw HTML in Go?
You can — templ already makes that pleasant. What the library adds is the long tail every team re-invents, badly and repeatedly: focus traps, aria wiring, dark-mode variants, CSP nonces, RTL-safe layout classes. Here they are typed, tested, and documented once.
Am I locked into HTMX?
No. Components render plain, semantic HTML first; HTMX attributes are opt-in wiring, self-hosted by default so no CDN request leaves your app. If you prefer Datastar, the wire package renders one action spec into either dialect, and swapping transports is a one-line change.
How much styling control do I have?
All of it. Components emit standard Tailwind utility classes — no DaisyUI, no CSS-in-JS, no shadow DOM. Redefine a Tailwind theme token to recolor every component at once, merge your own classes into any component through BaseProps, and conflicts resolve through tailwind-merge.
What does it cost?
Nothing. MIT licensed — read the license — no paid tier, no telemetry. The dependency list is short and auditable — templ and tailwind-merge-go at the core, with integrations like HTMX, Datastar, ECharts, and error pages as separate opt-in modules. Adopt one component or all of them; deleting the import deletes the library.
Try it on one screen.
Pick one component — a Table, a Toast, a StatCard — and drop it into an existing templ page. If it does not fit, delete the import. There is nothing to uninstall.