Hacker News new | past | comments | ask | show | jobs | submit login

How do you handle things like menu pop-ups and toggling/hiding content? I keep wanting to use htmx and it's like, but there always seem to be very common tasks like having an expandable menu on mobile that don't have a great solution in these libraries and I have to write vanilla JS.

I've settled on Alpine instead for the time being because it has some data management built in. I'm thinking I'm going to have to switch to Vue on my current project because I feel so much less productive with Alpine.




htmx is focused on increasing the network-oriented expressiveness of HTML, rather than on pure front end enhancements.

For something like menu popups or toggling content on the front end, I would expect an application to use a front end framework like bootstrap, or perhaps WebComponents, or a scripting solution like Alpine, in conjunction with htmx.

Alpine and htmx complement one another nicely, particularly since htmx 0.2.0, when we started firing kebab-style event names.


Ah for whatever reason I always saw this as an either-or scenario, not in tandem.

That gives me hope as I’ve wanted to use htmx on a project. Gonna start playing around with it tonight. Thanks!


Basically, you can toggle visibility on your pop up menus or modals with standard CSS/HTML. The visibility class/attribute can be controlled declaratively or imperatively without much JS. You can even use CSS transitions to add nice smooth animation to your menu/overlay.

#UseThePlatform




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: