Install via npm
Install Nuclo, wire up TypeScript, and build your first imperative UI with explicit update() calls.
Get up and running with Nuclo in three steps.
Add Nuclo's built-in types for all 140+ tag builders:
Or use a per-file reference: /// <reference types="nuclo/types" />
One import registers all global builders — no destructuring needed:
Deno? Import directly: import 'npm:nuclo' or pin it via deno.json imports.
A counter that demonstrates state, events, and explicit update().
Mutate plain JavaScript variables, then call update() once to sync all dynamic bindings:
import 'nuclo' registers all 140+ global tag builders — no destructuring, no tree-shaking concerns.
State is just plain JS variables — no hooks, proxies, or stores needed.
() => value zero-arg functions become dynamic bindings, re-evaluated on every update().
on(event, handler) attaches DOM listeners and returns a modifier any tag builder accepts.
render(element, container) mounts once — all subsequent updates run through update().
The heartbeat of every Nuclo app. Mutate state freely, call it once, and every dynamic binding re-runs.
Batch many mutations into one DOM pass.
You decide exactly when the UI updates.
Set a breakpoint on update() to trace every change.
No hidden re-renders, watchers, or dependency tracking.
Any zero-arg function passed as a child or attribute becomes a live binding that re-evaluates on update().
The arrow function re-runs when you call update().
Any attribute value can be a function.
Individual style properties bind independently.
The on() helper returns a modifier accepted by any tag builder, keeping your event logic co-located with the element.
Attach a single listener:
Stack multiple listeners on one element:
You can also pass standard addEventListener options as a third argument: on('click', handler, { once: true }).
You've got the essentials — explore what makes Nuclo powerful on larger projects.