Skip to content

wmkit documentation ​

Headless window manager for the web. The root README is the tour; these pages are the reference.

PageWhat is in it
API referenceevery export, option, method, event and type
Adapterscomplete React, Vue, Svelte, Solid, Angular, Preact, Lit and Qwik integrations, plus <wm-desktop> web components
Themingdata-wm-* contract, CSS variables, writing a theme from scratch
Recipesbuilding a window from scratch, taskbar, modals, persistence, workspaces, SSR, testing
Browser supportbaselines per entry point and what degrades where

Mental model ​

Three layers, each usable on its own:

text
createWindowManager()   state machine — bounds, stacking, stages, focus, history. No DOM.
attachDesktop()         DOM controller — pointer, keyboard, ARIA, snap preview, animations.
adapters                thin wrappers — wire the two above into a framework lifecycle.

The manager never reads or writes the DOM, so it runs in Node and during SSR. The controller never renders content — it moves and labels elements you already own. Window content therefore stays in your component tree: no innerHTML, no portals, no re-parenting.

Vocabulary ​

TermMeaning
windowan entry in the manager: id, bounds, stage, layer, workspace, flags, meta
stagenormal, minimized, maximized or snapped — mutually exclusive
layernormal < floating (always on top) < modal (blocks focus below)
workspacea virtual desktop index; only one is active at a time
zonea snap target: halves, quarters or thirds of the viewport
desktopthe element you pass to attachDesktop; it is the coordinate space
interactiona live gesture grouped into one undo entry

Install ​

bash
pnpm add @surdeddd/wmkit

Entry points: . (core + DOM), ./react, ./vue, ./svelte, ./solid, ./angular, ./preact, ./lit, ./qwik, ./elements and ./elements/define (web components), ./persist, ./popout, ./gestures, ./devtools, ./chrome, ./dock, ./winbox, ./themes (the stylesheets as text) and ./themes/*.css. ESM and CJS, types per condition, zero dependencies.