Add reactivity to an ordinary HTML page
A page already has its HTML. Give changing data a home, derive the values you need, and let bindings keep a small part of it up to date.

A useful page often starts with HTML that already works. A server renders the content, a form collects a few values, and a small script adds behaviour. Then the relationships multiply: a name appears in a greeting, a quantity changes a total, or a filter changes both a list and its summary.
Domma Reactive lets you write those relationships once. State lives in observables, derived values live in computeds, and bindings connect them to existing HTML. You choose which part of the page to activate.
Start with one relationship
Suppose an input holds someone's name and a paragraph greets them. The greeting should change as they type. Clearing the name should produce a useful fallback. Resetting it from JavaScript should update both elements.
That is enough behaviour to expose the important pieces without hiding them inside a larger application.
Give state a home
An observable holds a value that can change. In JavaScript, read and write it through its .value property. A computed derives another value by reading observables. Those reads establish its dependencies.
Here is the model running in the example above:
export function createGreeting() {
const name = observable('Ada');
const greeting = computed(() => {
const person = name.value.trim();
return person ? `Hello, ${person}!` : 'Hello, stranger!';
});
return {
name,
greeting,
reset() { name.value = 'Ada'; }
};
}The input and the greeting share one name. The reset function writes that name; it does not need to find the input or update the paragraph. The greeting's fallback also lives in one place, alongside the relationship that needs it.
The call to trim() belongs in JavaScript. It derives a display value without changing the spaces someone is currently typing into the input.
Let HTML declare what it uses
<div class="demo-stage">
<label>
Your name
<input class="form-input" data-model="name.value" autocomplete="off">
</label>
<p data-bind-text="greeting.value"></p>
<button type="button" class="btn btn-sm" data-on-click="reset">Reset</button>
</div>The model binding writes through name.value, a writable path to the observable's value. The text binding reads greeting.value, because it needs a value to display. The click binding names the reset function.
Finally, applyBindings(viewModel, element) activates the bindings inside the element you provide. That can be a single panel on a much larger page. Its surrounding navigation, server-rendered content and styles continue to work as before.
Each binding tracks the reactive values it reads. A name change updates the bindings that depend on that name. You do not write a second routine to keep the displayed message in sync.
Keep calculations in the model
The same arrangement scales to a price calculator: quantity and unit price are observables; the total is computed. For a search panel, the query is state and a filtered list is derived state. For a form, validity can be computed from the fields it checks.
Keep expressions in your markup small. Domma Reactive parses binding expressions without eval or a Function constructor. Ordinary display bindings do not run arbitrary method calls, so calculations such as trimming strings or building a search query belong in the view model. Event bindings provide the place to invoke actions.
The expression guide explains the supported syntax and its boundaries.
Choose it for a page with relationships
This approach is useful when several parts of an existing page depend on the same changing data. A single independent click handler may be all a smaller page needs. A shared input, summary and validation message are a good reason to give those relationships a model.
Domma Reactive supplies the reactive core and DOM bindings. Your application still chooses how to fetch data, store it and navigate between pages. The live applications show it working with Domma JS and Domma CMS; the greeting here uses the standalone package.
Make the page yourself
Your first reactive page turns this example into a complete HTML file you can save and run. It takes about ten minutes and needs no build tool.
Once that feels familiar, build the contacts system: a keyed list, search, inline editing, persistence and reusable components, introduced one step at a time.
