4 ms·
I love the idea! I think htmx occupies a very interesting skill-set/use-case niche and I think an RSS reader is a cool example of that. One piece of feedback:
by rpastuszak 3y ago
I love the idea! I think htmx occupies a very interesting skill-set/use-case niche and I think an RSS reader is a cool example of that.
One piece of feedback: the UI would feel more snappy if there was a way of applying optimistic updates/signalling to the user the loading state. I'm not an htmx expert but I think you can do that with alpine.
Example:
When I click on the feed item, there's a short delay before the UI updates itself with page content. Sometimes the delay can take a few seconds.
Ideally, I'd see a simple loading indicator or an animation signalling the loading state, even greying out the element would be enough.
(In that particular case you could probably cheat a bit with CSS, by styling the :active state of the list item element, and then adding a very slow transition. But, that doesn't solve the general issue)
Edit:
Thanks @anyone explaining that this is achievable with `hx-indicator`. I never learn by just reading the docs so I guess I need to build sth with htmx.
- recursivedoubts 3y agoyou can use hx-indicator for a spinner: https://htmx.org/attributes/hx-indicator/ https://htmx.org/attributes/hx-indicator/ depending on how aggressive you want to get, you can use the preload extension to make the responses snappier: https://htmx.org/extensions/preload/ https://htmx.org/extensions/preload/
- rpastuszak 3y agoNice, I didn't know about this. Thanks! I can imagine this could probably work quite well with View Transitions.
- recursivedoubts 3y agoyeah, you can toggle on view transitions in a swap via an hx-swap option: https://htmx.org/docs/#view-transitions https://htmx.org/docs/#view-transitions for now css transitions are more widely supported though: https://htmx.org/docs/#css_transitions https://htmx.org/docs/#css_transitions
- infogulch 3y agoI'm using view transitions (have to use Chrome to see it), basically just copy-pasted the example from the htmx site. I'd like to do a sliding-opening animation, but I haven't figured out how to do that yet.
- gyanreyer 3y agoHTMX actually has a built-in way to show loading states. You just have to add a child element with the class "htmx-indicator" and HTMX will fade that element in while it's waiting for a response.
- rpastuszak 3y agoThanks! Now I'm looking for excuses for new side project to build with htmx