Skip to content

IdleKitBuild idle games that scale.

A modular TypeScript toolkit for idle and incremental games — headless engine, economy transactions, gameplay mechanics, lifecycle plugins, persistence and DOM bindings. Every piece optional, every piece typed.

Ten lines to a running game

ts
import { createEngine } from "@idlekitjs/core";
import { Renderer, bindText } from "@idlekitjs/dom";
import { createRafScheduler } from "@idlekitjs/browser/raf-scheduler";

interface State {
  coins: number;
}

const renderer = new Renderer();
const engine = createEngine<State>({
  initialState: { coins: 0 },
  renderer,
  scheduler: createRafScheduler(),
});

engine.addSystem((state, dt) => {
  state.coins += dt; // 1 coin per second
});

const coins = document.querySelector<HTMLElement>("#coins")!;
renderer.add(bindText(coins, () => Math.floor(engine.state.coins).toString()));

engine.start();

That is a complete game: a typed state, a deterministic simulation, and a DOM binding that only touches the page when the displayed value changes. IdleKit provides the engine — your game is what you build on top of it. Follow the quickstart to build it step by step.

The toolkit

PackageWhat it gives you
@idlekitjs/coreHeadless engine: simulation loop, reactive state, events, saves, numbers, RNG
@idlekitjs/domDOM renderer and declarative bindings
@idlekitjs/browserBrowser bridges: page lifecycle, rAF scheduler, screen helpers
@idlekitjs/economyExplicit resources, requirements, transactions, costs and rewards
@idlekitjs/mechanicsProducers, modifiers, collections, projects, crafting, boosts, containers, timers, pickups
@idlekitjs/pluginsEngine policies: autosave and offline progress
@idlekitjs/storagePersistence backends: memory, localStorage
@idlekitjs/typesShared contracts (Extension, SaveAdapter, Binding, ...)
@idlekitjs/utilsPure helpers, platform-agnostic

Where to go next