A walkthrough showing how to integrate Shoelace web components with a Spring Boot and Thymeleaf application to display toast notifications. The demo uses htmx to handle a purchase button click, triggering a POST request that returns an HX-Trigger response header, which JavaScript then uses to fire Shoelace Alert Toast notifications for success or error states — all without page reloads. The setup uses ttcli to scaffold the project, adds Shoelace as a WebJar, and wires everything together with a small amount of JavaScript.

5m read timeFrom wimdeblauwe.com
Post cover image

Sort: