htmx
Developer(s) | Carson Gross |
---|---|
Initial release | November 24, 2020[1] |
Stable release | 2.0.2[2]
/ August 12, 2024 |
BSD 0-clause[3] | |
Website | htmx |
HTML |
---|
Comparisons |
htmx (also stylized as HTMX) is an
The library supports communication with the
History
htmx has its roots in intercooler.js, a frontend library created by Carson Gross in 2013.[4] The library aimed to address the complexity associated with AJAX (asynchronous JavaScript and XML) by introducing a simplified approach using HTML attributes.[5] The intent was to create a framework that was aligned with Roy Fielding's original intent for REST (representational state transfer) - and specifically HATEOAS (hypermedia as the engine of application state). The problem is described in Fielding's blog post "REST APIs must be hypertext-driven" from October 2008.[6][7]
htmx was created as an improved version of intercooler.js that did not rely on jQuery with version 1.0.0 being released in November 2020.[8] The release of htmx was a significant milestone for the project, by offering a way to utilize AJAX, CSS transitions, WebSockets, and Server-Sent Events directly in HTML using attributes.[9]
In 2023, htmx was added to the first cohort of the GitHub Accelerator program, a program the provides open source projects with funding and guidance from members of mature open source projects.[10]
Design and functionality
htmx combines the capabilities of modern
The library also challenges the common approach of utilizing
Usage
htmx adds custom attributes to HTML to define dynamic behavior such as triggering server requests and updating content. The functionality of htmx is built off of the attributes hx-get
, hx-post
, hx-put
, hx-delete
, andhx-patch
, which issue AJAX requests with the specified HTTP method.click
for other elements.[11] The event can also be overridden with hx-trigger
.[22] Other attributes include hx-target
for specifying a target other than the current element for swapping content into and hx-swap
for setting how the content fetched from the server should be swapped or placed relative to the target element.[23][24]
Community and adoption
Since its inception as intercooler.js and its subsequent evolution into htmx, the library has gained a significant following within the web development community.[25][26] htmx has been viewed as a simpler and lighter weight alternative to full-blown JavaScript frameworks like React, Vue.js, and Angular.[27][28] As a result, it has gained a measure of popularity as an alternative to the approach used by most JavaScript frameworks for building dynamic web applications.[29]
htmx integrations have been developed for various full-stack/backend web frameworks, programming languages and templating engines, including Node.js, Django, Flask, Adobe ColdFusion, ASP.NET, Java, Clojure, and Ruby on Rails.[30] Such libraries are usually matter of nothing more than convenience since htmx's portable and minimalist design allows it to be integrated with virtually any HTML templating engine.[12]
See also
References
- ^ "Release v1.0.0 - HTMX". GitHub.
- ^ "Releases - HTMX". GitHub.
- ^ "htmx/LICENSE". HTMX. Retrieved 2024-04-30 – via GitHub.
- ^ "htmx 1.0.0 has been released". HTMX. 2020-11-24. Retrieved 2024-04-04.
- ^ a b Melanson, Mike (2022-01-19). "Htmx: HTML Approach to Interactivity in a JavaScript World". The New Stack. Retrieved 2024-04-24.
- ^ Gross, Carson. "Simple AJAX using HTML attributes". Intercooler.js. Retrieved 2024-04-24.
- ^ Fielding, Roy T. (20 Oct 2008). "REST APIs must be hypertext-driven » Untangled".
- ^ "htmx ~ htmx 1.0.0 has been released!". htmx.org. Retrieved 2024-04-24.
- ^ "htmx | Technology Radar". Thoughtworks.
- ^ Sowles, Kara (2023-04-12). "GitHub Accelerator: our first cohort and what's next". The GitHub Blog. Retrieved 2024-04-24.
- ^ a b c Hibbard, James (2023-08-08). "An Introduction to htmx, the HTML-focused Dynamic UI Library". SitePoint. Retrieved 2024-04-04.
- ^ a b Tyson, Matthew (2023-09-20). "Intro to HTMX: Dynamic HTML without JavaScript". InfoWorld. Retrieved 2024-04-24.
- ^ "Introduction to HTMX | refine". 26 October 2023.
- ^ Tyson, Matthew (2024-03-13). "Complexity bad: An interview with HTMX creator Carson Gross". InfoWorld. Retrieved 2024-04-24.
- ISBN 978-1-4842-3089-3, retrieved 2024-04-30
- ^ "A First Look at HTMX and How it Compares to React". Builder.io.
- ^ "htmx ~ Essays". htmx.org. Retrieved 2024-04-30.
- ^ a b "htmx ~ Documentation". htmx.org. Retrieved 2024-04-30.
- ISBN 9781491903100.)
{{cite book}}
: CS1 maint: location (link - ISBN 978-1-7281-2903-7.
- Hochschule Heilbronn.
- ^ Jack, Bobby (2024-01-22). "What Is htmx and How Can It Simplify My Website?". MUO. Retrieved 2024-09-03.
- ^ "htmx ~ hx-target Attribute". htmx.org. Retrieved 2024-09-03.
- ^ "htmx ~ hx-swap Attribute". htmx.org. Retrieved 2024-09-03.
- ^ "@htmx_org". X (formerly Twitter). Retrieved 2024-05-19.
- ^ "htmx.org". npm. 2024-04-17. Retrieved 2024-04-30.
- ^ Tyson, Matthew (2024-04-01). "What's the best JavaScript framework?". InfoWorld. Retrieved 2024-05-19.
- ISBN 9781098111878.
- ^ Letusheva, Valeria (2024-05-09). "Highlights from the Django Developer Survey 2024". InfoWorld. Retrieved 2024-05-19.
- ^ "htmx ~ Server-Side Examples". htmx.org. Retrieved 2024-05-19.