Skip to content

Integrate ​

Embed On-Codemerge with @codemerge/integrate (+ peer on-codemerge).

bash
npm install on-codemerge @codemerge/integrate

UI guides show framework state → value / onChange only. Packs, upload, and document IO live in shared pages below.

CSS loads with UI entries (/react, /element, /mount, …). Root import is host API only. Explicit: import '@codemerge/integrate/styles'. Not pulled by /protocol.

Aliases (same runtime as the target): /preact /angular /solid /qwik /backbone → /mount; /lit /astro → /element; /remix → /react; /vanilla → root.

Start here ​

GuideWhen
React / Vue 3pass value + watch changes
Host configplugins pack, upload, locale, collab
Persistencedocument load/save (bindPersistence)
Server + ViteLaravel / Slim / Express / … + WC
Meta SSRNext / Nuxt / SvelteKit / … (client only)
Native bridgeiframe / Flutter / Tauri postMessage
Chrome & hostchrome, portals, raw Editor

Per-stack pages are short deltas — they link back to the family guides above.

Quick React example ​

tsx
import { useState } from 'react';
import { CodeMergeEditor } from '@codemerge/integrate/react';

export function App() {
  const [html, setHtml] = useState('<p></p>');
  return <CodeMergeEditor value={html} onChange={setHtml} />;
}

Advanced ​

Raw new Editor + createCorePlugins() — Chrome & host, Editor API.

Released under the MIT License.