Text Interpolation
Attribute Binding
Event Handling
List Rendering
Copy this code, save as index.html, and open it in your browser. No npm install.
<!-- index.html -->
<div id="app">
<h1>{{ title }}</h1>
<button @click="increment()">Count: {{ count }}</button>
</div>
<script type="module">
import { HTMP } from 'https://unpkg.com/htm-projection@1.1.0/dist/esm/index.js';
const app = new HTMP('app', document.getElementById('app').outerHTML);
app.setProxy({ title: "Hello HTMP", count: 0 });
app.setProgram({
increment: () => app.proxy.count++
});
app.mount('app');
</script>
This button is powered by HTMP running right now on this Landing Page.
Explore different use cases. Click tabs to see the full code snippet and live result.
{{ activeCode }}
HTMP is not just for simple widgets. It powers full SPA applications, TypeScript projects, and complex admin panels. This list will continue to grow.
We initiated reactivity on the AdminLTE User Table using HTMP. Features reactive search, dynamic status badges, and event handling inside :for loops β without jQuery. Proving HTMP is ready for enterprise dashboards.
A Single Page Application built with HTMP and the native browser History API. Ticket list, route-based detail views, and SPA navigation β no framework router needed. HTMP's lifecycle controls (mount, unmount, remount) make full SPA flows possible at 3.6 KB.
HTMP as the presentation layer of a TypeScript project. Set the type of your proxy data, then instantiate new HTMP<TypeProxy>(rootId, pattern) β no type errors on proxy usage, even when nested like proxy.data.profile.name.
Yes, this very page is powered by HTMP. The reactive counter, the interactive tab switching in the gallery, and the dynamic LiveCodes playground updates are all driven by the 3.6 KB engine. Dogfooding at its finest.
Designed for pragmatists. Built for the backend-driven web.
No JSX. No x-data magic. Write the HTML you already write β add {{ }} or :for β and it just works. Designers see their design in production, not a JSX translation of it.
Powered by native Proxy + DOMParser. State changes β HTMP jumps directly to the exact DOM node via a path registry. No diffing. No VDOM. No reconciliation.
No new syntax. Conditionals are ternary operators. Loops are :for β and you already know for loops. Your JavaScript skills transfer 100%.
No :key. No <template> wrapper. No :if. Render irregular nested trees β 4-level, 3-level, or 2-level β with a single :for expression. Real-world data isn't uniform. HTMP doesn't pretend it is.
HTMP coexists with any library β jQuery, Bootstrap plugins, browser extensions. If the DOM shifts, the registry auto-recovers: it finds the displaced node, updates its path, and resumes surgical patching. No manual remount(). No data loss.
No Vite. No Webpack. No Babel. No tsconfig. Copy-paste, save as index.html, open in browser. HTMP runs from file://.
For TypeScript projects: npm install htm-projection and configure your favorite compiler β HTMP works seamlessly with any build setup.
Smaller than snabbdom (4.7 KB). Smaller than virtual-dom (5.3 KB). 15Γ smaller than React + ReactDOM. Zero dependencies. Tree-shakeable.
HTMP uses standard Web APIs that browser vendors have invested in, standardized, and optimized for decades. No proprietary runtime to maintain β the platform is the runtime.
Stop storing Bearer Tokens in localStorage where XSS vulnerabilities can leak them.
HTMP encourages standard web security by working seamlessly with native fetch and HttpOnly Cookies.
// Clean API calls without frontend token storage
const res = await fetch('/api/v1/user/profile', {
credentials: 'include' // Cookies managed safely by browser
});
How HTMP eliminates team friction, protects design integrity, and speeds up time-to-market.