Datastar: A Hypermedia Framework Built Around Signals and SSE
The hypermedia framework.
At a glance
- What is it?
- Datastar ships as a single script tag that adds reactive data-* attributes to server-rendered HTML. It is a fit for teams that want server-driven state without a JavaScript build step, and a poor fit for anyone expecting a component ecosystem.
- Who is it for?
- Adopt Datastar if you are building server-rendered pages or real-time collaborative views and want reactivity without a JavaScript build pipeline; the README's own example is an 11.89 KiB module script plus data-* attributes. Do not adopt it if your team depends on a component library, a TypeScript-first frontend workflow, or client-side routing, because none of those appear in the repository's top-level entries.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 14 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 2, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The problem Datastar solves: reactivity without a build step
Most reactive frontends assume you will ship a JavaScript application. That means a bundler, a package manager, a component tree, and a client that owns the state. Datastar takes the opposite position. The README describes it as "a lightweight framework for building everything from simple sites to real-time collaborative web applications," and the entry point is a single script tag. State lives in signals, and the DOM is updated through declarative data-* attributes rather than through hand-written event handlers and render functions.
The audience is narrow but real. It is for teams whose HTML is already produced by a server (Django, FastAPI, Go, and similar, judging by the SDK directory) and who want interactivity on top of that HTML without introducing a second application architecture. It is also for people who found htmx sufficient for swapping fragments but wanted client-side state and expressions in the same tool. If your product is a large single-page application with client-side routing and a shared component library, Datastar is not aimed at you, and the README does not pretend otherwise.
Signals, data-* attributes and the SSE event stream
The mechanism is visible in the README's own snippet. A signal is a named piece of reactive state, referenced in attributes with a dollar sign prefix. `data-bind:title` binds an input to a signal called `title`. `data-text` renders an expression against that signal and re-renders when it changes. `data-on:click` attaches a handler, and the handler can call a backend action such as `@post('/endpoint')`.
The interesting half is on the server side. Datastar's real-time story is Server-Sent Events, which is what the related searches around "Datastar SSE" point at. The server holds the authoritative state, pushes updates down the event stream, and the client patches signals and DOM accordingly. That is a different data flow from a JSON API plus a client store: there is one source of truth, it lives on the server, and the browser is a rendering surface.
Two consequences follow. First, the repository is organised around that split: `library/` holds the client code, `bundles/` holds the built distributables, and `sdk/` holds the server-side helpers. Second, the expressions in data-* attributes are evaluated in the browser against the signal graph. The README does not document the expression evaluator's exact semantics or its error handling, so anything beyond the simple examples it shows should be checked against the Getting Started guide before you rely on it.
Install Datastar in one script tag and wire up a first binding
There is no npm install step in the README. Installation is a module script pointing at a versioned bundle on jsDelivr, which the README shows pinned to v1.0.4. Drop it into the page before your markup uses any data-* attribute.
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/[email protected]/bundles/datastar.js"></script>With the script loaded, the README's three-line example is a complete first use: a bound input, a derived text node, and a button that posts to a server endpoint.
<input data-bind:title />
<div data-text="$title.toUpperCase()"></div>
<button data-on:click="@post('/endpoint')">Save</button>Typing in the input should update the div immediately, since `data-text` re-evaluates against the `title` signal. Clicking Save issues a POST to `/endpoint`; what the server does with it, and whether it responds over SSE, is not shown in the README and belongs to the Getting Started guide. For backend integration, the repository exposes an `sdk/` directory rather than a documented install command, so check which languages are actually present there before planning around one.
Where Datastar stops: thin documentation and a young 1.x line
The README is auto-generated, and it says so in its first line. That is a useful signal about the project's own priorities: the README is a signpost to data-star.dev, not a reference. Almost every substantive question, including how signals are scoped, how the SSE stream is formatted, and what happens when a connection drops, is answered on the website or not at all in the repository. If you need offline-readable documentation in the repo, this is not that project.
The release cadence is also worth reading carefully. v1.0.2 landed on 2026-06-02, v1.0.3 on 2026-08-27, and v1.0.4 on 2026-09-21. That is a stable-looking 1.x line, but the gap between v1.0.2 and v1.0.3 is nearly three months, and the project is still in its first major version. Pinning the CDN URL to a specific version, as the README does, is the sane default; loading the bundle unversioned means an upstream release can change behaviour under you.
The real failure mode is architectural, not technical. If your team's instinct is to reach for a component library when a UI gets complicated, Datastar will feel like a dead end, because there is no component model in the repository layout and the README does not describe one. The same applies to anyone who needs client-side routing: nothing in the top-level entries or the README addresses it.
Datastar vs htmx: same server-driven premise, different centre of gravity
The comparison people actually search for is Datastar against htmx, and the difference is where state lives. htmx is built around swapping HTML fragments: you mark up elements with attributes that trigger requests, and the server returns HTML that replaces part of the page. Datastar also does server-driven updates, but it adds a client-side signal graph on top, so expressions like `$title.toUpperCase()` can run in the browser without a round trip.
That extra layer is the whole trade-off. You get local reactivity and a cleaner path to real-time collaborative views, because signals can be patched from an SSE stream rather than only by replacing DOM subtrees. You pay for it with a second concept to learn and with expressions that the README does not fully specify. A team that only ever needs fragment swaps is carrying machinery it will not use; a team that keeps writing small JavaScript helpers to compute derived values next to its htmx attributes is exactly the team Datastar is aimed at. Alpine.js sits on the other side of the same line: it is a client-side reactivity layer you bolt onto server-rendered HTML, with no opinion about how updates arrive from the server. Datastar's opinion is the SSE stream.
Maintenance, versioning and the MIT licence
The repository is not archived, and the last push was on 2026-09-21, two days before this writing, with v1.0.4 released the same day. That is a recent commit history, and the 1.x versioning plus a CHANGELOG.md at the top level suggests the project intends to document breaking changes rather than ship them silently. The default branch is `develop`, not `main`, which means the README's CDN example and the release tags are the stable surface; if you vendor from the branch, you are tracking unreleased work.
Upgrade cost is mostly a question of how you pin. The README's script tag embeds `@v1.0.4`, so a minor upgrade is a one-line edit plus a re-read of the CHANGELOG. If you self-host the bundle from `bundles/`, you own that copy and the upgrade is manual. Server-side SDKs under `sdk/` presumably version separately, and the README does not describe their release process, so verify that before assuming client and server move together.
The licence is MIT, per the repository metadata and LICENSE.md. That is permissive: it allows commercial use and modification with attribution and no warranty. This is not legal advice; if your organisation has a policy on bundled third-party scripts, the fact that the README's default install pulls from a CDN at runtime is the detail worth raising, since it puts a third-party host in your page's critical path.
Editorial conclusion
Adopt Datastar if you are building server-rendered pages or real-time collaborative views and want reactivity without a JavaScript build pipeline; the README's own example is an 11.89 KiB module script plus data-* attributes. Do not adopt it if your team depends on a component library, a TypeScript-first frontend workflow, or client-side routing, because none of those appear in the repository's top-level entries. Before committing, verify the SDK for your backend language under sdk/, confirm the signal and SSE behaviour against the Getting Started guide at data-star.dev, and check the CHANGELOG for what changed between v1.0.2 and v1.0.4.
Frequently asked questions
What is Datastar?
Datastar is a hypermedia framework for building sites and real-time web applications on top of server-rendered HTML. The README describes it as a single script tag plus declarative data-* attributes for frontend reactivity.
How do I use Datastar?
Add the module script from the README to your page, then use data-* attributes such as data-bind, data-text and data-on to bind inputs, render expressions and call backend endpoints. The README points to the Getting Started guide at data-star.dev for the full walkthrough.
What are the key differences between Datastar and htmx?
Both drive updates from the server, but Datastar adds a client-side signal graph, so expressions can be evaluated in the browser and signals can be patched over an SSE stream. htmx is centred on swapping HTML fragments returned by the server.
What are the key differences between Datastar and React?
React builds a client-side application with a component tree, while Datastar keeps the HTML server-rendered and adds reactivity through data-* attributes and signals. The repository layout shows a client library, bundles and server SDKs, with no component model described in the README.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/starfederation-datastar)