web-editor
web-editor
is a small React framework for building in-browser IDEs. It's the engine
behind the TurboWarp Extension Maker — but it's
deliberately generic: nothing in it knows about TurboWarp.
It gives you:
- A custom resizable split-pane layout (
SplitPane,Panel) — nestable, with sizes persisted tolocalStorage. No third-party panel library. - A Monaco editor (
CodeEditor) with locally-bundled language workers (so it works under cross-origin isolation, where CDN workers are blocked). - An xterm.js terminal (
TerminalPanel) bound to an interactive WebContainer shell — full ANSI, realls/cat/npm/node. - A file tree (
FileTree) with Seti file-type icons. - A WebContainer build engine (
WebContainerEngine) — boot,npm install, run a build, read the output back out, stream all of it to the terminal. - Radix UI primitives (
Button,IconButton,Tooltip,Switch,StatusBadge, …) themed with a dark Tailwind palette.
Install
It's published built (via Rslib) and ships its components,
the Seti icon set, and a raw styles.css you process with Tailwind CSS v4.
How it fits together
You create an editor instance with createEditor(), describing the project
to scaffold and how to build it, then render the components inside an
EditorProvider:
The engine boots a WebContainer, mounts the files, installs, builds on demand
(or on save), and streams everything to the terminal. The editor's blocks plug
into whatever your createProject returns — your app supplies the
domain-specific parts (the project template, the build command, what to do with
the built output).
Tailwind setup
browser-ide-kit/styles.css is Tailwind v4 source (it declares @import 'tailwindcss', the theme tokens, and @source for its own built components).
Import it from your app's stylesheet and add a @source for your own files:
Cross-origin isolation
WebContainers (and Monaco's bundled workers) require the page to be
cross-origin isolated — COOP: same-origin + COEP: credentialless. Set
those headers on your dev server and host, or use a
coi-serviceworker shim on a
static host that can't set headers.
Complete apps
Two full applications are built on web-editor — read either to see the
framework wired up end to end (and try the live versions):
- dev-local — a general-purpose in-browser code editor (editor · terminal · live preview), with no domain-specific tooling. The simplest end-to-end example.
- TurboWarp Extension Maker — a domain-specific IDE that adds an embedded Scratch VM, blocks editor, and stage on top.