About
Built for apps that render on the server
HTMX UI is a component library for server-rendered apps that use htmx. Components are plain HTML styled with Tailwind CSS, plus a few small behaviours that survive htmx swaps.
How it works
The package ships design tokens, component styles and a handful of behaviours. You import one stylesheet, copy the markup you need from the docs, and the server keeps rendering HTML. When htmx swaps a fragment in, the behaviours inside it initialise themselves — nothing to re-wire by hand.
This site
The site is built with the library itself: each file in site/pages is a route,
rendered with Nunjucks at build time and bundled by Bun. The docs come from Markdown, with a
version switcher and a search palette as plugins on top of the engine.
Read the documentation, browse the components,
or copy the source of this page — it is all in the repository under site/.
Principles
Three things we hold to
Plain HTML first
Every component is markup you can read, copy and paste. Behaviour is optional, small and idempotent — never a hidden runtime.
Tokens, not variants
Colour, radius and motion are CSS variables mapped into Tailwind v4. Theme the kit by overriding a handful of them.
Built for swaps
Behaviours re-run on whatever htmx just inserted, so a fragment arrives already wired up.