Skip to content

Installation

Alacris is ESM-only and has no dependencies. There is nothing to configure.

The fastest way to try it, and a perfectly good way to ship it. No bundler, no install:

<script type="module">
import { define, html, signal } from 'https://unpkg.com/@alacris/core@0.11.3';
define('hello-world', () => html`<p>hello</p>`);
</script>
<hello-world></hello-world>
import { define, html, signal } from 'https://unpkg.com/@alacris/core@0.11.3';
import { store } from 'https://unpkg.com/@alacris/core@0.11.3/dist/store.js';
import { createContext } from 'https://unpkg.com/@alacris/core@0.11.3/dist/context.js';
Terminal window
npm install @alacris/core
import { define, html, signal, computed, effect } from '@alacris/core';
import { store, selector } from '@alacris/core/store';
import { createContext, provide, consume } from '@alacris/core/context';

TypeScript declarations ship with the package. There is nothing to add.

If you want buttons, fields, and a theme rather than starting from define(...), install Alacris UI (@alacris/ui on npm). It is sixty-eight custom elements and a theme engine, and it works in any framework that can render a tag.

Add-ons import the core rather than bundling it, so there is exactly one reactive graph at runtime however many you use.

ImportWhat it isgzip
@alacris/coresignals, templates, styling, custom elements6.56 kB
@alacris/core/storedeep reactive state, selector1.03 kB
@alacris/core/contextthe context protocol0.54 kB
@alacris/core/signalreactivity alone, no DOM1.03 kB

If you use a bundler, anything you do not import is tree-shaken away — the package is marked sideEffects: false.

Alacris uses <template>, TreeWalker, custom elements and — for styles — constructable stylesheets, with a <style> fallback where those are missing.

That means Chrome and Edge 86+, Safari 16.4+, and Firefox 101+. There are no polyfills and no transpiled build; the published code is modern ESM.