Modern frontends with htmx
$34.99
Minimum price
$34.99
Suggested price

Modern frontends with htmx

Use htmx with Spring Boot and Thymeleaf to build dynamic and interactive web application

About the Book

Imagine creating dynamic, interactive web applications with minimal JavaScript. That’s the revolutionary promise of htmx, a technology that redefines frontend development. This book is your gateway to mastering htmx alongside Java, Spring Boot, and Thymeleaf, transforming the way you build web interfaces.

This book starts with the basic steps of using htmx, starting from the basic techniques of DOM element swapping through various triggers. It progressively delves into more complex topics, such as responding to htmx requests in the Spring Boot controller and implementing comprehensive UI patterns like lazy loading, active search, and endless scrolling. Further, the book dives into the integration of web components and JavaScript frameworks with htmx to amplify client-side interactivity.

Throughout the book, two projects put all these ideas together. These projects help you see how everything you've learned works in real web applications.

About the Author

Wim Deblauwe
Wim Deblauwe

Wim Deblauwe is a freelance Java developer who has been working mainly with Java and Spring for the past 25 years. He has developed and designed various software projects that have seen deployments worldwide. He also loves to guide and teach others about topics like Java, Spring, and Thymeleaf.

Bundles that include this book

$59.98
Bought separately
$49.95
Bundle Price

Table of Contents

  • 1. Technologies used in the book
    • 2.1 htmx
    • 2.2 Spring Framework
    • 2.3 Spring Boot
    • 2.4 Thymeleaf
    • 2.5 Alpine
    • 2.6 Tailwind CSS
  • 2. Getting started
    • 3.1 Prerequisites
    • 3.2 ttcli
    • 3.3 IntelliJ IDEA plugins
    • 3.4 Summary
  • 3. Starting with htmx
    • 4.1 Hello world example
    • 4.2 Triggers
    • 4.3 Targets
    • 4.4 Swapping
    • 4.5 HTTP verbs
    • 4.6 Summary
  • 4. Request and response headers
    • 5.1 Request headers
    • 5.2 Response headers
    • 5.3 Htmx-spring-boot library
    • 5.4 Summary
  • 5. Project 1: TodoMVC
    • 6.1 Initial implementation
    • 6.2 Boost the application
    • 6.3 Fine-grained htmx implementation
    • 6.4 Summary
  • 6. Out of Band Swaps
    • 7.1 General principles
    • 7.2 Example
    • 7.3 Summary
  • 7. Client-side scripting
    • 8.1 Vanilla JavaScript
    • 8.2 AlpineJS
    • 8.3 Summary
  • 8. Security
    • 9.1 Htmx and security
    • 9.2 Bookmarks
    • 9.3 Classic Thymeleaf setup
    • 9.4 Use htmx for adding a bookmark
    • 9.5 Deleting a bookmark
    • 9.6 Handle logout
    • 9.7 Summary
  • 9. Project 2: Contact application
    • 10.1 Setup project
    • 10.2 Add a contact
    • 10.3 Search
    • 10.4 View contact
    • 10.5 Edit and delete a contact
    • 10.6 Delete using htmx
    • 10.7 Inline validation of duplicate email addresses
    • 10.8 Pagination
    • 10.9 Active search
    • 10.10 Delete row from list
    • 10.11 Archive list of contacts
    • 10.12 Summary
  • 10. Web components
    • 11.1 What are web components?
    • 11.2 Integrating Shoelace
    • 11.3 GitHub Tree
    • 11.4 Summary
  • 11. Server-sent events & websockets
    • 12.1 Server-sent events
    • 12.2 Websockets
    • 12.3 Summary

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub