vincent15000's avatar

Discussion around Livewire / VueJS vs htmx

Hello,

I know Livewire and VueJS quite well, but I don't know htmx (just some quick tries).

I wonder ... if I have an application in which only one or two pages are really complex, is it worth using Livewire or VueJS for these pages ? or is it better to use htmx ?

I have seen that htmx seems to be very light beside of Livewire or VueJS.

Who has already used htmx ? Is it a good idea ?

Thanks for your answer.

V

1 like
4 replies
jlrdw's avatar
jlrdw
Best Answer
Level 75

After viewing the videos on it I did try it out some. My conclusion was to just stick with Axios js for what I need. Mainly fill fields dynamically without a page reload.

But I don't know your use case. I would imagine behind the scenes it's doing the exact same thing as regular javascript and axios js anyway.

Edit:

In fact here: https://htmx.org/examples/edit-row/

The example, I do similar inline edit with javascript and either axios js or fetch js. I have used both. I just reload the table and not whole page. But nothing wrong with it. I would say experiment some with it.

1 like
vincent15000's avatar

I especially thought about htmx for some reasons :

  • I want to avoid using VueJS just for one or two pages, for me it has no sense (unless I would have developed all the frontend with VueJS)

  • I want to avoid using Livewire because some datas could be exposed to the frontend as mentioned in the documentation

  • with htmx, all is done backend side and htmx seems to be lighter than VueJS

ian_h's avatar

I've not played with htmx, but with your knowledge/experience of LW and Vue.. I'd probably do this with AlpineJS instead as you've likely used this with LW and has a similar syntax to Vue and both light weight and flexible enough to do what you need.

1 like
Snapey's avatar

Livewire components can be as simple or as complex as you need.

You also have complete control over what data is exposed to the frontend.

The big benefit of Livewire over htmx is that you don't need to design any ApI to have dynamic content on your pages.

Its a no-brainer for me. Livewire everytime.

1 like

Please or to participate in this conversation.