A few examples on using HTMX.
The examples use a Node/Express server.
All of the HTMX is in the /public
.html files.
Examples include...
request.html
: Demonstrates how to trigger events, make GET requests, pass request params, set data output target, set loading indicator target, etctemperature.html
: Simple temperature converter that demonstrates form submission (POST request) with HTMXpolling.html
: Example of HTMX polling using a mock weather apisearch.html
: A contact search feature that filters data from jsonplaceholder/typicode.com/usersvalidation.html
: Form validation exampleprofile.html
: Profile card feature, click-to-edit -> save-and-display (uses xss lib)
Install dependencies
npm install
Run the server with nodemon
npm run dev
Run the server with node >= v18
node --watch server.js
Visit the following pages...