Introduction
Reactive primitives for any runtime: signals, data, routing, DOM and browser state. JSX, custom elements and the UI Kit are optional modules.
ElementsKit is a library of reactive primitives. Pick one, use it in plain JavaScript, React, a custom element, or on the server. Everything builds on one small core; JSX, custom elements and the UI Kit are modules you add only if you want them.
Coreelements-kit/signals
Primitiveselements-kit/utilities/*
One import per job.
Renderingelements-kit/render
Build DOM from signals.
Integrationselements-kit/integrations/*
Every piece is its own import, so you ship only what you use.
- Compose, don't configure. Small focused APIs:
signal,computed,on,fromEvent,async. Combine primitives instead of maintaining an overloaded interface. - Close to the platform.
promiseextendsPromise. Custom elements areHTMLElement. JSX compiles todocument.createElement. No virtual DOM, no proxies. - Predictable and explicit, no magic. Signals are reactive; nothing else is. No hidden subscriptions.
- Designed for the AI age. Code is cheap; maintenance still isn't. Swap one block at a time.
Install
pnpm add elements-kitFull setup (TypeScript JSX config, CDN, Deno) in Installation.
import { , , } from "elements-kit/signals";
import { } from "elements-kit/utilities/network";
import { } from "elements-kit/utilities/media-query";
import { } from "elements-kit/utilities/event-listener";
const = (0);
const = ("(prefers-color-scheme: dark)");
const = (() => `${()} clicks · ${() ? "online" : "offline"}`);
const = .("button")!;
(, "click", () => (() + 1));
(() => {
. = ();
...("dark", ());
});Same signals in every tab. See the full progression (signals → element → component → custom element) in the Quick start.
Built for the AI age
Explicit contracts survive edits by humans or agents. Machine-readable index: /llms.txt (short) · /llms-full.txt (every page concatenated).
Start here
Installation
Install the package and configure JSX in your TypeScript project.
Quick start
Build a reactive counter five ways, from signals to custom elements.
Philosophy
Four principles behind the API: compose don't configure, close to the platform, predictable and explicit, designed for the AI age.
Explore
Signals
Core: signal · computed · effect · batch · onCleanup
Stores
Core: @reactive classes shared across components and frameworks
Primitives catalog
Every primitive, by area, with where it runs
Async & promise
Primitives: queries, mutations, revalidation without a query library
Routing
Primitives: location, URL patterns and navigate
Form object
Primitives: read and write a form as a nested object
JSX elements
Rendering: JSX → real DOM with live bindings
Custom elements
Rendering: native HTMLElement with signals and decorators
React
Integrations: useSignal · useScope
Data fetching recipe
Example: async + retry + online + window focus
ElementsKit is built and maintained by the Quba team.