htm/a

5KB

Server-side reactivity. Zero dependencies.

The Problem with Modern Web

React

  • 500KB+ bundle for a simple app
  • Complex state management
  • Build tooling overhead
  • Client does all the work

htm/a

  • 5KB total bundle size
  • Server manages all state
  • Zero build step required
  • Type-safe Rust backend

Size Comparison

React
~140KB
Vue
~80KB
HTMX
~15KB
htm/a

The EASL Pattern

A linear, unidirectional architecture that keeps complexity where it belongs: on the server.

E

Event

User action on client

A

Actor

Business logic on server

S

Stream

HTML updates to client

L

Lined

Linear, unidirectional

See It in Action

The Actor

<htma-actor name="Counter">

    {% let value: i32 = 0 %}

    <htma-template>
        <div class="counter">
            <h1>{{ value }}</h1>
            <button htma-action="decrement">-</button>
            <button htma-action="increment">+</button>
        </div>
    </htma-template>

    {% action increment sync %}
        {% value += 1 %}
    {% endaction %}

    {% action decrement sync %}
        {% value -= 1 %}
    {% endaction %}

</htma-actor>

The Result

0

Features

Zero Dependencies

No npm, no node_modules, no build step. Just include the script.

Type-safe Rust

Catch errors at compile time. No runtime surprises.

WebSocket & SSE

Real-time bidirectional or unidirectional streaming. Your choice.

Actor Model

Isolated state, message passing, no shared mutable state.

HTMX Superset

Start simple with HTTP. Upgrade to WebSocket when ready.

5KB Bundle

75x smaller than React. Fast on any connection.

Get Started

Three steps. That's all it takes.

1

Create a new project

cargo new my-app
cd my-app
cargo add htma
2

Include the client

<script src="htma.js"></script>
3

Connect to your Actor

<htma-endpoint url="/ws">
    <htma-actor name="Counter"></htma-actor>
</htma-endpoint>

Resources