Skip to main content

2 posts tagged with "templates"

View All Tags

Fiber + HTMX: Interactive Apps Without the Build Step

ยท 5 min read
Fiber Team
Maintainers

For a lot of applications - admin panels, dashboards, internal tools, CRUD frontends - the default stack of a JavaScript SPA talking to a JSON API is more machinery than the problem needs. Two codebases, a bundler, a node toolchain in CI, and client-side state that mirrors what the server already knows.

HTMX takes the opposite approach: the server renders HTML, and a small script extends HTML with attributes like hx-get and hx-target so any element can fetch a fragment and swap it into the page. No build step, no client-side router, no JSON serialization layer.

Fiber is a natural fit for this. Its template engines render fragments fast, the whole application compiles to one binary, and the request handling you already know - routing, binding, middleware - is all there is to learn. Let's build a live-search contact list to see the full loop.

Template Engines

ยท 4 min read
Fiber Team
Maintainers

Not every project is a JSON API. Sometimes you need to render HTML - a landing page, an admin panel, an email template, a server-rendered app. Fiber supports 9 template engines through a single Views interface, so you pick the syntax you like and Fiber handles the rest.

The surprising part is not the number of engines. It is that switching from one engine to another requires changing exactly two lines of code: the import and the engine constructor. Your handlers, layouts, and rendering calls stay the same.