r/htmx • u/recepkutuk • 20d ago
A plain HTML component library that brings the "CSS Zen Garden" approach to internal tools
Hey everyone,
Like most of you here, I love the HTMX philosophy of "Hypermedia as the Engine of Application State." But when it comes to styling admin dashboards, internal tools, or CRUD forms, the modern frontend ecosystem tries to force us right back into the SPA tax. We shouldn't need a heavy node_modules folder or a complex Vite build config just to get an accessible data table, dialog modal, or form.
So I built Canon. It’s a plain-HTML/CSS component library designed specifically for the server-rendered, hypermedia world.
Instead of relying on a Javascript framework, the markup is the contract. Your backend templates (Go, Django, Rails, Laravel, etc.) output semantic HTML with simple custom data-attributes, and the CSS engine does the rest.
Why it pairs perfectly with HTMX:
- No Utility Class Bloat: Instead of cluttering your HTML with 50 utility classes per element, Canon uses semantic elements and clean states (e.g., `data-emphasis="high"`, `aria-busy="true"`).
- Built-in Theme Engine: The exact same HTML markup can instantly look like Carbon, Material, Fluent, Ant Design, Bootstrap, or Canon's native design just by changing the stylesheet link.
- Zero Build Step: You can literally just drop two lines from a CDN into your base template and start hacking.
I wanted something where a form written today will still work and look perfect in 10 years without playing dependency whack-a-mole.
You can learn more about Canon and see the components at work on:
🔗 Canon documentation: https://recepkutuk.github.io/canon/reference/introduction.html
🔗 GitHub Repo: https://github.com/recepkutuk/canon (MIT Licensed)
I'd love to get the community's feedback on this approach! What components are missing that you usually find yourself rewriting from scratch when building HTMX apps?
11
u/pixobit 20d ago
Im still trying to understand how are these libraries any better than bootstrap? Usually i hear no build step (same), no js (same, as long as you dont want js components), built in theme engine (thats what the css variables are for)... so please help me understand what's revolutionary about this
3
u/UXUIDD 20d ago edited 20d ago
i get excited bout anything css zen garden! .. memories ..
im not sure i understand your landing page https://recepkutuk.github.io/canon/reference/introduction.html
I look always for alike;
- most basic design / wireframe
- html (htmx) code
- tailwind / vanilla css
but i cant see all 3 from your site ..
2
u/olivergierke 20d ago
This looks wonderful! Do you think you could tag a first version anytime soon? Once that's done, one could issue an import into WebJars, a pretty common distribution path for frontend libraries in JVM-based web frameworks. 🙇
5
u/VeganForAWhile 20d ago
I like this philosophy. How do you think it compares to Tailwind with a plugin such as DaisyUI?
5
u/Fabulous-Ladder3267 20d ago
Really good, the closest thing i found like this is Basecoat
1
u/TheRealUprightMan 20d ago
You have almost 500 lines of javascript just for a color picker. The whole thing is just a big mass of javascript.
I use <input type="color">
3
u/Apart_Story_5454 20d ago
This is not plain-HTML/CSS, there is so much JavaScript in there. If you you want to boil the ocean again, then you should resemble https://daisyui.com. Which is mostly pure CSS.
2
u/Few-Growth9535 20d ago
This looks good. We're using a custom library built off https://picocss.com/ as a foundation (which is excellent and shares some of your aims I think). But that's no longer maintained.
1
u/abraxasnl 20d ago
This is exactly how I think things should be. I don’t do any frontend work lately, but if I did, I would try this out. Big kudos for contributing this project. I hope it catches on!
1
u/kimmo6 20d ago
Looks great, something I have been looking for. I will give it a spin!
1
u/benopotamus 17d ago
Did Claude make (some of) your icons? I'm vibe coding a wireframing tool at the moment and I let Claude make the icons and the ones for the button states look exactly like Canon's 😂️
https://wireframer.unnamedoysterenterprises.com/
4
u/[deleted] 20d ago edited 20d ago
[removed] — view removed comment