How bigskysoftware/htmx works
htmx is a browser-side hypermedia client: HTML attributes declare when and how to request server-rendered content, and htmx applies responses to the page. The principal flow is user events through attribute processing and trigger handling, request construction and HTTP exchange, response processing, then DOM swapping and URL/history updates. The README also identifies CSS transitions, WebSockets, and server-sent events as capabilities; extension source files are not sampled, so those branches are documented but their internal links remain unverified. Core behavior is implemented in a single large source file, so internal stages share its path.
Main entry points: htmx.js Event triggers · preload.js Preload extension · sse.js Server-sent events · ws.js WebSockets
Components 17
HTML interaction
- Attribute-driven HTML
- Attribute processing
src/htmx.js - Event triggers
src/htmx.js
Request lifecycle
- Input values
src/htmx.js - Request setup
src/htmx.js - HTTP transport
src/htmx.js
Response and page
- Response handling
src/htmx.js - DOM swapping
src/htmx.js - Browser DOM and history
- CSS transitions
src/htmx.js
Transport extensions
- Extension API
src/htmx.js - Preload extension
www/themes/htmx-theme/static/js/preload.js - Server-sent events
dist/ext/sse.js - WebSockets
dist/ext/ws.js - _hyperscript
www/themes/htmx-theme/static/js/_hyperscript.js
Other components
- User
- Application server
Connections 17
- User → Event triggers: fires event
src/htmx.js - Attribute-driven HTML → Attribute processing: declares behavior
README.md - Attribute processing → Event triggers: configures triggers
src/htmx.js - Event triggers → Input values: collects inputs
src/htmx.js - Event triggers → Request setup: starts request
src/htmx.js - Request setup → HTTP transport: configures exchange
src/htmx.js - HTTP transport → Application server: sends HTTP request
README.md - Application server → HTTP transport: returns HTML
README.md - HTTP transport → Response handling: delivers response
src/htmx.js - Response handling → DOM swapping: applies response
src/htmx.js - DOM swapping → Browser DOM and history: updates DOM
- DOM swapping → CSS transitions: supports transitions
README.md - Extension API → Preload extension: registers extension
www/themes/htmx-theme/static/js/preload.js - Preload extension → Request setup: preloads targets
www/themes/htmx-theme/static/js/preload.js - Attribute-driven HTML → Server-sent events: enables SSE
README.md - Attribute-driven HTML → WebSockets: enables WebSockets
README.md - Attribute-driven HTML → _hyperscript: scripts behavior