Examples

Every example ships in the repository under examples/ and runs with ghtmx generate && go run ./cmd

Hello world

The walking skeleton: one template, one route, one rendered page.

Live demo ↗

Route bindings

Symbol and constructor bindings: every htmx URL is resolved against a real Go route at build time.

Live demo ↗

Fragments

Compile-time fragments rendered inline in a page and standalone for htmx swaps, byte-identically.

Live demo ↗

Events

The server-driven event contract: declared events, generated HX-Trigger emitters, and CSRF headers.

Live demo ↗

CRUD todos

The reference application: full CRUD with partial updates and zero hand-written htmx glue.

Live demo ↗

htmx 4: explicit inheritance

htmx 4 inherits nothing by default: :inherited and :inherited:append declare a wrapper's reach, and the compiler warns where it was lost.

Live demo ↗

htmx 4: status routing and partials

hx-status:422 sends validation errors to their own region, 5xx bodies are dropped, and <hx-partial> updates a second region from one response.

Live demo ↗

htmx 4: QUERY and morph swaps

The bound QUERY verb searches as you type, and innerMorph keeps the entries you expanded while the list changes.

Live demo ↗