Use HTMX to Create Laravel Single-Page Apps Without Writing JavaScript

Use HTMX to Create Laravel Single-Page Apps Without Writing JavaScript

A developer from Montana looked at the front-end wild west (full of frameworks, libraries, bundlers, runtimes, and more) and had an idea: "What if we go back to basics? What if we just use HTML... with extra powers?"

I’m not sure if that’s how HTMX came about, but I like to imagine Carson Gross created it in the same way Professor Utonium created the Powerpuff Girls—hypermedia, spice, and everything nice.

HTMX is a lightweight library that lets you enhance HTML elements to manage AJAX, WebSockets, and Server-Sent Events.

Want to click a button to subscribe via AJAX without writing a line of JS? Here’s how:

<button
    id="subscribe"
    hx-trigger="click"
    hx-post="/subscribe"
    hx-target="this"
    hx-swap="outerHTML">
    Subscribe
</button>

Read this intro to HTMX and the powerful applications you can create with it on Tighten's blog:

And make sure to visit the official website, or even check out the fantastic book: Hypermedia Systems.