Targ Apps Docs
Chroma

Introduction

What Chroma is, who it is for, and where to start building.

Chroma is a fine-grained reactive web framework whose engine runs on Rust and WebAssembly.

You can ship the same app portably in the browser or as an executable through Chroma Desktop. The APIs and plugins look the same from your code; storage, origins, and dev workflow depend on the runtime mode.

You write the UI as plain JavaScript functions in .chr files. When a value changes, Chroma updates only the text node or attribute bound to it. There is no virtual DOM, no diffing, and no JSX compiler.

In plain words: a component is a normal function that runs once and builds real DOM nodes. A piece of state is a getter you hand to the DOM, and the DOM follows it.

// src/App.chr
import { hookState, e } from "../pkg/chroma.js";

export function App() {
  const [count, setCount] = hookState(0);

  return e(
    "button",
    { onClick: () => setCount(count() + 1) },
    "Count: ",
    count,
  );
}

Clicking the button updates only the text node bound to count. Nothing re-renders.

Why Chroma

  • Each component runs exactly once. Reactive expressions stay bound to the exact DOM node they update.
  • The whole engine is WASM. Signals, dependency tracking, e, Fragment, and every DOM operation live in the .wasm binary. The only JavaScript in the package is the loader generated by wasm-bindgen.
  • No build step in development. chroma dev serves your .chr files directly. chroma build bundles and minifies them for production with Chroma's own compiler. Nothing else to install: no Node.js, no npm, no node_modules (see prerequisites).

The one rule

A child or an attribute is reactive only if you pass it as a function. The full explanation is in Reactivity.

What is included

  • Hooks: hookState, useEffect, useLayoutEffect, useMemo, useCallback, useRef, useReducer, createContext / useContext, useDebugValue.
  • Control-flow components: Show, For.
  • Style helpers: cva, cx.
  • Core functions: render, e, Fragment, and the screen router (createRouter, matchRoute, parseQuery).

Not included: keyed list reconciliation, DevTools. SSR is not available. See Limitations.

The toolchain

PieceWhat it does
CLIchroma install, new, dev, build, validate
Dev serverStatic server behind chroma dev (Chroma-Server)
Runtime modesPortable (web) vs executable (Desktop) — same APIs, different host behavior
DesktopTauri shell that runs chroma build bundles locally
PluginsStorage (Chroma-Fs), styling (Chroma-Style), API routing
Extensions by modePer-plugin Portable vs Executable matrix (browser, Desktop, editor tools)
Linter and VS CodeManifest and .chr diagnostics in the editor

Who it is for

Chroma is built for organizations of any size, from a single team's tool to the application portfolio of a large company. Every app shares one .chr UI format and one chroma.json manifest, so teams ship employee-facing tools and public products without a different stack per project, and the same app can run in the browser or as a desktop executable.

License

Chroma and its first-party toolchain are licensed under the GNU GPL v3 and are free to use, including in commercial products. See Licensing.

Where to go next

On this page