mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 07:21:05 +00:00
42 lines
1.7 KiB
Markdown
42 lines
1.7 KiB
Markdown

|
|
|
|
*high power tools for HTML*
|
|
|
|
[](https://gitter.im/intercooler-js/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
[](https://app.netlify.com/sites/htmx/deploys)
|
|
[]()
|
|
|
|
## Introduction
|
|
|
|
htmx is a set of extensions (attributes, request headers, etc.) that help you build
|
|
[modern UI](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 HTML.
|
|
|
|
htmx is small ([~6k 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),
|
|
IE11 compatible & you can try it out quickly & easily, without a huge rewrite.
|
|
|
|
## Quick Start
|
|
|
|
```html
|
|
<!-- Load from unpkg -->
|
|
<script src="https://unpkg.com/htmx.org@0.0.4"></script>
|
|
<!-- have a button POST a click via AJAX -->
|
|
<button hx-post="/clicked" hx-swap="outerHTML">
|
|
Click Me
|
|
</button>
|
|
```
|
|
|
|
The `hx-post` and `hx-swap` attributes tell htmx:
|
|
|
|
> "When a user clicks on this button, issue an AJAX request to /example, and replace the entire button with the response"
|
|
|
|
htmx is based on [intercooler.js](http://intercoolerjs.org) and is the successor to that project.
|
|
|
|
## Website & Docs
|
|
|
|
[https://htmx.org](https://htmx.org)
|
|
|
|
[https://htmx.org/docs](https://htmx.org/docs)
|