Real-time collaboration
Block-level sync with live presence over any transport — WebSocket relay, BroadcastChannel, or your own backend. Every client converges to the same document.
collaboration={session}Presence markersOffline resync
Drop a fast, secure editor into your app for docs, knowledge bases, blogs and team notes — with slash commands, tables, Markdown, Ask AI and live collaboration. One tiny core, two native adapters, MIT licensed.
npm i @xproeditor/reactThe exact package you install from npm. Type / for blocks, select text for the toolbar, or try Ask AI — it runs on a mock transport, so no API key is needed.
This is the real @xproeditor/react package — not a mockup. Try the tips below, or open a block's ··· menu.
Type **bold**, *italic*, `code` or ~~strike~~ inline, and # , - , 1. , [x] at the start of a line. ⌘/Ctrl+Alt+1 turns a block into a heading; ⌘/Ctrl+Shift+↑ moves it.
Nested under the toggle — great for FAQs and long docs.
Also try /toggle heading 1–3 in the slash menu.
<ProEditor
defaultValue={blocks}
toolbar="floating"
ai={{ transport }}
/>Notion-like block editor for Vue and React — open source on GitHub.
github.comHover a block for ··· · resize tables · drag across cells · use code language / wrap / copy.
Empty line — type /table, /bookmark, or paste:
# Hello
- from Markdown
- paste me here
Active tip: Slash menu — Type / on an empty line. Theme switch only flips --xpe-* variables.
Pass a session to collaboration and every edit syncs block by block with live presence. Bring any transport — a WebSocket relay, BroadcastChannel, or your own backend. No CRDT library, no vendor lock-in.
import { ProEditor, createCollabSession, createWebSocketTransport } from '@xproeditor/react'
const session = createCollabSession({
transport: createWebSocketTransport('wss://relay.example.com/doc-42'),
blocks: savedBlocks, // same document on every client
user: { name: 'Sara' },
})
<ProEditor defaultValue={savedBlocks} collaboration={session} />Selection, paste, tables, AI, collaboration and theming are first-class — not bolted-on demos.
Block-level sync with live presence over any transport — WebSocket relay, BroadcastChannel, or your own backend. Every client converges to the same document.
collaboration={session}Presence markersOffline resyncHistory stores only the blocks a step changed — not the whole document — and undo never reverts a collaborator’s edits.
Block-level stepsPer-user undoRows keep identityShared block model, selection, and clipboard in @xproeditor/core — Vue and React stay behavior-identical.
@xproeditor/core@xproeditor/vue@xproeditor/reactSticky format toolbar, Notion-like floating bubble, both, or none — switch with one prop.
toolbar="floating"toolbar="fixed"/ slash menuRicher block context menu, multi-select with a floating edit popover, and two-stage Ctrl/⌘+A.
Block ··· menuMulti-select popoverReliable undoDrag or shift-select across blocks — including images and tables — then copy, cut, delete, or paste Markdown.
Multi-block copy/cutMarkdown pasteHTML + JSON clipboardTable width, drag cell select, merge and style — plus code language/wrap/copy chrome, buttons, and web bookmarks.
Width + cell dragCode wrap & copyBookmark linksHost supplies any LLM transport. Users get /ai, toolbar entry, streaming drafts, and Accept / Reject.
ai={{ transport }}Improve / continueNo API keys in the packagePrecompiled stylesheet. Restyle with --xpe-* variables — no Tailwind or Radix lock-in for consumers.
--xpe-primaryDark via .xpe-darkRTL readyType **bold**, `code`, # headings, - lists or [x] to-dos and they convert as you type. Turn into, move and duplicate blocks from the keyboard.
**bold** / `code`⌘⌥1 heading⌘⇧↑ move blockEvery label, tooltip and placeholder comes from one dictionary. English and Persian ship built in; override any string or add a language.
locale="fa"dictionary={{ … }}Per-block auto directionAllow-listed embeds for YouTube, Vimeo, Loom, Figma, CodePen, CodeSandbox, Spotify, SoundCloud and Maps — plus a live, linked table of contents.
/embed/table of contentsAnchored headingsLinks, media sources, colours and pasted HTML/JSON are sanitized in core, so stored or pasted content can’t inject script — in the editor or the renderer.
javascript: blockedSanitized HTML exportValidated clipboardOnly the block you type in re-renders, the highlighter loads on demand, and a full document API (getBlocks, setBlocks, getMarkdown, getStats…) is on the ref.
Memoised rowsLazy highlight.jsref.getMarkdown()Collapsible toggles and toggle headings (H1–H3) nest content cleanly for docs, FAQs, and long posts.
/toggle/toggle headingNested childrenSame Block[] document powers the editor and the public page. Pick a use case, edit, then switch to Published to see the read-only render.
Authors draft with / and Ask AI; readers get a clean article via DocRenderer.
Most teams do not need another text box — they need structured content that looks right on the public site and still feels fast to write.
// Edit
<ProEditor defaultValue={blocks} onChange={setBlocks} />
// Publish
<DocRenderer blocks={blocks} />Switch to Published above — this draft becomes the public article, instantly.
Tip: select a paragraph and run /ai → Improve writing before you publish.
Blog flow: draft with ProEditor → persist blocks → render the post route with <DocRenderer blocks={post.blocks} />.
Twenty-four block types in the document model — plus Ask AI as an agent overlay, not a block. Open the demo and type / to try any of these.
No Tailwind, no Radix, no shadcn required — styles ship precompiled. Pass ai.transport only when you want Ask AI. For public pages, render the same blocks with DocRenderer.
npm install @xproeditor/reactimport { ProEditor, DocRenderer, createBlock } from '@xproeditor/react'
import '@xproeditor/react/style.css'
import { useState } from 'react'
const initial = [createBlock('heading_1', { content: [{ text: 'My post' }] })]
export default function BlogAdmin() {
const [blocks, setBlocks] = useState(initial)
const [published, setPublished] = useState(false)
if (published) return <DocRenderer blocks={blocks} />
return (
<ProEditor
defaultValue={blocks}
toolbar="floating"
onChange={setBlocks}
/>
)
}Install only what you need — adapters share behavior through @xproeditor/core.
Yes. All three packages are MIT licensed — use them in commercial, closed-source or open-source apps. There is no paid tier and no API key.
Yes. @xproeditor/vue (Vue 3.4+) and @xproeditor/react (React 18 and 19) are two thin adapters over one framework-agnostic core, so both behave the same and store the same JSON.
Yes. Pass a session from createCollabSession to the collaboration prop. Edits sync block by block with live presence markers, over BroadcastChannel (no server), a WebSocket relay, or your own transport.
As a plain Block[] JSON array with stable ids — easy to save in any database. Export to Markdown, sanitized HTML or plain text with one call, and render it read-only with DocRenderer.
No. Styles ship precompiled in one CSS file. Restyle with --xpe-* CSS variables, switch to dark with the xpe-dark class, and right-to-left languages work out of the box.
Links, media URLs, colours, pasted HTML and JSON, AI output and collaboration messages are sanitized in core, so stored or pasted content cannot inject script into the editor or the renderer.
Yes. Ask AI takes a transport function you write — OpenAI, Anthropic, a local model or your backend. The package never ships or asks for API keys.
Generated from each package’s CHANGELOG.md and rendered with the editor’s own DocRenderer. Every release is semver; breaking changes are always called out.
@xproeditor/react 0.8.1# , code fence, ---, Turn into, the bubble toolbar, keyboard shortcuts): every path now keeps the block's indent, direction and column (placementProps).columnArrowTarget).@xproeditor/react 0.8.0/2 columns and /3 columns in the slash menu; the group's bar sets the count, width presets, gap, vertical alignment and stacking on small screens, or removes the columns and keeps their content.insertBlocks fit blocks to the column they land in; the block menu moves a block to another column.DocRenderer renders a grid that stacks on narrow containers; HTML export renders a CSS grid; Markdown and plain text flatten in reading order.columns.ts (createColumnsGroup, normalizeColumns, fitInsertedBlocks, setColumnCount, moveBlockToColumn, unwrapColumns, wrapInColumns, …), column-aware subtrees, collapsed toggles and list numbering, and dictionary strings in English and Persian.@xproeditor/react 0.7.0Mod+/ to toggle comments, and language detection when pasting into an empty block — shared core logic in CODE_LANGUAGES, indentCode, newlineInCode, toggleCodeComment and splitHighlightedLines. Tables: row and column handles (insert, move, duplicate, sort, align, clear, delete), drag-to-resize columns (colWidths), a header column (hasHeaderColumn), spreadsheet paste from Excel/Google Sheets, Tab in the last cell adds a row, and a cleaner floating toolbar instead of always-visible controls. DocRenderer and HTML export honour column widths, header columns, code file names and line numbers. Syntax colours are themeable through --xpe-syntax-* variables.createCollabSession to the new collaboration prop and edits sync block by block with live presence markers. Ships with createBroadcastChannelTransport (no server), createWebSocketTransport (any relay, reconnects and resyncs) and createMemoryCollabHub; remote messages are sanitized like pasted content.onChange now receives a fresh array on every change, so onChange={setBlocks} re-renders as expected. Vue ProEditor/BlockEditor emit update:modelValue (so v-model works), keep a plain non-reactive model-value array editable, and expose canUndo/canRedo on ProEditor.createBlockHistory in core) instead of a full-document snapshot per step — far less memory on long documents, untouched rows no longer re-render on undo/redo, and undo never reverts a collaborator's edits.placeFloating and resolveEditorAnchor. Toggle chevrons now rotate smoothly (one rotate() per state, 220 ms, reduced-motion aware) in the editor and DocRenderer.