1 | [![</> htmx](https://raw.githubusercontent.com/bigskysoftware/htmx/master/www/img/htmx_logo.1.png "high power tools for HTML")](https://htmx.org)
|
2 |
|
3 | *high power tools for HTML*
|
4 |
|
5 | [![Discord](https://img.shields.io/discord/725789699527933952)](https://htmx.org/discord)
|
6 | [![Netlify](https://img.shields.io/netlify/dba3fc85-d9c9-476a-a35a-e52a632cef78)](https://app.netlify.com/sites/htmx/deploys)
|
7 | [![Circle CI](https://circleci.com/gh/bigskysoftware/htmx.svg?style=shield)](https://app.circleci.com/pipelines/github/bigskysoftware/htmx)
|
8 |
|
9 | ## introduction
|
10 |
|
11 | htmx allows you to access [AJAX](https://htmx.org/docs#ajax),
|
12 | [WebSockets](https://htmx.org/docs#websockets) and [Server Sent Events](https://htmx.org/docs#sse)
|
13 | directly in HTML, using [attributes](https://htmx.org/reference#attributes), so you can build
|
14 | [modern user interfaces](https://htmx.org/examples) with the [simplicity](https://en.wikipedia.org/wiki/HATEOAS) and
|
15 | [power](https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm) of hypertext
|
16 |
|
17 | htmx is small ([~8k min.gz'd](https://unpkg.com/htmx.org/dist/)),
|
18 | [dependency-free](https://github.com/bigskysoftware/htmx/blob/master/package.json),
|
19 | [extendable](https://htmx.org/extensions) &
|
20 | IE11 compatible
|
21 |
|
22 | ## quick start
|
23 |
|
24 | ```html
|
25 | <!-- Load from unpkg -->
|
26 | <script src="https://unpkg.com/htmx.org@0.2.0"></script>
|
27 | <!-- have a button POST a click via AJAX -->
|
28 | <button hx-post="/clicked" hx-swap="outerHTML">
|
29 | Click Me
|
30 | </button>
|
31 | ```
|
32 |
|
33 | The [`hx-post`](https://htmx.org/attributes/hx-post) and [`hx-swap`](https://htmx.org/attributes/hx-swap) attributes tell htmx:
|
34 |
|
35 | > "When a user clicks on this button, issue an AJAX request to /clicked, and replace the entire button with the response"
|
36 |
|
37 | htmx is the successor to [intercooler.js](http://intercoolerjs.org)
|
38 |
|
39 | ## website & docs
|
40 |
|
41 | * <https://htmx.org>
|
42 | * <https://htmx.org/docs>
|
43 |
|
44 | ## contributing
|
45 |
|
46 | * please write code, including tests, in ES5 for [IE 11 compatibility](https://stackoverflow.com/questions/39902809/support-for-es6-in-internet-explorer-11)
|
47 | * please include test cases in [`/test`](https://github.com/bigskysoftware/htmx/tree/dev/test) and docs in [`/www`](https://github.com/bigskysoftware/htmx/tree/dev/www)
|
48 | * if you are adding a feature, consider doing it as an [extension](https://htmx.org/extensions) instead to
|
49 | keep the core htmx code tidy
|
50 | * development pull requests should be against the `dev` branch, docs fixes can be made directly against `master`
|
51 |
|
52 | ## haiku
|
53 |
|
54 | *javascript fatigue:<br/>
|
55 | longing for a hypertext<br/>
|
56 | already in hand*
|