--- title: HTMX date: 2025-06-07 19:30:00 background: bg-[#ff5f4d] tags: - frontend - javascript - htmx categories: - Programming intro: | A modern, minimal JavaScript library that allows you to create dynamic web interfaces using HTML attributes. plugins: - copyCode --- ## Getting Started {.cols-3} ### CDN Import ```html ``` ### Basic Usage ```html
``` ### Server Response ```htmlHello from server
``` ## Core Attributes {.cols-3} ### `hx-get`, `hx-post`, etc. ```html Load Page ``` ### `hx-target` ```html ``` ### `hx-trigger` ```html ``` ## Swap & Out of Band {.cols-3} ### `hx-swap` ```html ``` - `outerHTML` - `innerHTML` - `beforebegin`, `afterbegin`, etc. ### `hx-swap-oob` ```html ``` _Useful for global updates from partials._ ### Swap Modifiers ```html hx-swap="outerHTML transition:true swap:1s" ``` ## Forms & Events {.cols-3} ### Auto POST on Submit ```html ``` ### `hx-include` ```html ``` ### `hx-vals` ```html ``` ## Advanced Features {.cols-3} ### Loading Indicator ```htmlHello, HTMX!
" ``` ### HTML Client ```html ```