Skip to content

ryanlewis/spring-kotlin-htmx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot + kotlinx.html + HTMX Pattern Showcase

A showcase of common HTMX patterns built with Spring Boot, Kotlin, and kotlinx.html.

  • No template engine — kotlinx.html generates all markup in pure Kotlin
  • No JavaScript — HTMX handles interactivity through HTML attributes
  • No database — an in-memory data store keeps things simple

Home page

Patterns Demonstrated

Active Search

Real-time search-as-you-type with hx-trigger delay and loading indicators.

Active Search

Click to Edit

Inline editing with hx-get/hx-put and outerHTML swaps between view and edit modes.

Click to Edit

Bulk Update

Select multiple contacts and toggle their status in batch using hx-include and targeted hx-target.

Bulk Update

Infinite Scroll

Automatic pagination that loads more rows as you scroll, using hx-trigger="revealed".

Infinite Scroll

Delete Row

Confirmation dialogs with hx-confirm and smooth CSS fade-out transitions on hx-delete.

Delete Row

Lazy Loading

Deferred content loading with hx-trigger="load" and spinners for expensive operations.

Lazy Loading

Each pattern page includes a "View source pattern" section showing the key HTMX attributes used.

Running

# Linux / macOS
./gradlew bootRun

# Windows
gradlew.bat bootRun

Then visit http://localhost:8080/ in your browser.

Tech Stack

  • Spring Boot 3.5 with WebFlux
  • Kotlin 2.0
  • kotlinx.html 0.12 (type-safe HTML DSL)
  • HTMX 2.0
  • Pico CSS 2 (classless CSS framework)

License

See LICENSE.

About

A Spring Boot demo utilising kotlinx.html and htmx

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages