# µJS, a 5KB alternative to Htmx and Turbo with zero dependen…

I built µJS because I wanted AJAX navigation without the verbosity of HTMX or the overhead of Turbo. It intercepts links and form submissions, fetches pages via AJAX, and swaps fragments of the DOM. Single <script> tag, one call to `mu.init()`. No build step, no dependencies. Key features: patch mo…

- **Page:** https://magpie.gallery/i/js-a-5kb-alternative-to-htmx-and-turbo-with-zero-d-8wtc
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Runs on:** web
- **Tags:** javascript, ajax, navigation, frontend, library

## Source

Web · amaury_bouchard: µJS, a 5KB alternative to Htmx and Turbo with zero dependencies

- **Original:** https://news.ycombinator.com/item?id=47285876

> I built µJS because I wanted AJAX navigation without the verbosity of HTMX or the overhead of Turbo. It intercepts links and form submissions, fetches pages via AJAX, and swaps fragments of the DOM. Single <script> tag, one call to `mu.init()`. No build step, no dependencies. Key features: patch mode (update multiple fragments in one request), SSE support, DOM morphing via idiomorph, View Transitions, prefetch on hover, polling, and full HTTP verb support on any element. At ~5KB gzipped, it's smaller than HTMX (16KB) and Turbo (25KB), and works with any backend: PHP, Python, Go, Ruby, whatever. Playground: https://mujs.org/playground Comparison with HTMX and Turbo: https://mujs.org/comparison About the project creation, why and when: https://mujs.org/about GitHub: https://github.com/Digicreon/muJS Happy to discuss the project. https://mujs.org

## GitHub projects

- https://github.com/Digicreon/muJS

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
