---
title: "htmx (Sprig)"
description: "htmx allows you to access AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces…"
canonical_url: "https://www.codex.republic.se/languages/javascript/htmx-spring"
section: "Pages"
---

# htmx

***htmx*** allows you to access [AJAX](https://htmx.org/docs#ajax), [CSS Transitions](https://htmx.org/docs#css_transitions), [WebSockets](https://htmx.org/docs#websockets) and [Server Sent Events](https://htmx.org/docs#sse) directly in HTML, using [attributes](https://htmx.org/reference#attributes), so you can build [modern user interfaces](https://htmx.org/examples) with the [simplicity](https://en.wikipedia.org/wiki/HATEOAS) and [power](https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm) of hypertext.

---

***htmx*** is small ([~9k min.gz'd](https://unpkg.com/htmx.org/dist/)), [dependency-free](https://github.com/bigskysoftware/htmx/blob/master/package.json), [extendable](https://htmx.org/extensions) &amp; IE11 compatible.

- [htmx - high power tools for html](https://htmx.org/)
- [htmx - Documentation](https://htmx.org/docs/)
- [htmx - Examples](https://htmx.org/examples/)

## Sprig 🌱

*Sprig* is a free plugin for [Craft CMS](https://craftcms.com/) that allows you to create reactive components from Twig templates and/or PHP classes.

These components can re-render themselves on user-triggered events (clicks, changes to input fields, form submissions, etc.) using AJAX requests, without requiring you to write a single line of JavaScript.

Sprig enables common use-cases while completely avoiding full page refreshes:

- Live search
- Load more elements (with a button interaction or infinite scroll)
- Paginate, order and filter elements
- Add products to a cart
- Submit forms

### Links

- [putyourlightson/craft-sprig](https://github.com/putyourlightson/craft-sprig)
- [Sprig - A reactive Twig component framework for Craft.](https://putyourlightson.com/plugins/sprig)
