HTemplX
A Go and Templ UI library using mostly pure CSS / HTML.
Preamble
I started this repo so that I could have some reusable UI components for Go and Templ. I am a bit over the JavaScript framework hell, and if I can use as little JavaScript as possible, then I am happier for it.
To achieve this, I typically make use of Go, Templ, and HTMX (A JavaScript library, I know right, what a hypocrite!). Rather than sending a template down to the client to then be hydrated by some flavour of JavaScript framework and mucking around with state management, I make use of HTMX to perform AJAX requests.
This library is essentially my redpilling into HTMX and Hypermedia as the Engine of Application State HATEOAS. More or less, your HTML IS the state of your app. No need for complex convoluted framework wizardry to try and keep the front and back end in sync.
This is mostly just a library that I have created for myself, but if it becomes something people want to use, I would love the extra help and collaborative efforts! For simplicity, these components will be relatively opinionated/limited in scope and style. I don't really want to interface or validate all attributes of HTML and HTMX in this project so I will mostly make available what I feel is most helpful or useful.
Not everyone wants or needs to use JSON, so this one is for you.
Aims
- As little JavaScript as possible
- No reliance on CDNs to serve stylesheets, frameworks, or scripts
- Responsiveness by pure HTML / CSS as a first principle before leaning on JavaScript
- HTMX extensibility
- Flexibly opinionated component styling
Usage
More detail to be added here when components are added.
Contributions
Want something added? Check out the CONTRIBUTING.md file.
- Make an issue and I'll try and get to it
- Make the component yourself and submit a PR, I'll take a gander at it
- Note: Make sure you use the dev branch and not the main branch
License
MIT