NewReal-time collaboration

The Notion-style block editor for Vue & React

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/react
  • 24 block types
  • Live collaboration
  • English + فارسی / RTL
  • No Tailwind required
Live demo

Not a screenshot. The real editor.

The 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.

Tour the editor

This is the real @xproeditor/react package — not a mockup. Try the tips below, or open a block's ··· menu.

✨Type / for blocks · /ai for Ask AI · paste Markdown · drag-select blocks for the floating edit popover · ⌘/Ctrl+A twice to select all.

Type like Markdown

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.

Lists, toggles & tasks

•Headings, quotes, callouts, bookmarks
Toggle — click to expand nested notes

Nested under the toggle — great for FAQs and long docs.

Toggle heading

Also try /toggle heading 1–3 in the slash menu.

Markdown paste and multi-block clipboard
Try Ask AI on this line (select it, then /ai)

Code, CTA & bookmark

TSX
<ProEditor
  defaultValue={blocks}
  toolbar="floating"
  ai={{ transport }}
/>
xofdev/xproeditor

Notion-like block editor for Vue and React — open source on GitHub.

github.com

Embeds

Hover 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.

New · Real-time

Write together, live

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.

  • Conflict-free merge. Concurrent edits to different blocks, inserts and moves always merge; every client converges to the same document.
  • Collaboration-safe undo. Undo history is per user and per block, so you never undo someone else’s work.
  • Validated on arrival. Remote messages are sanitized like pasted content — a malicious peer can’t inject script.
  • Offline tolerant. The WebSocket transport buffers edits, reconnects with backoff and resyncs.
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} />
Capabilities

Everything a writing surface needs

Selection, paste, tables, AI, collaboration and theming are first-class — not bolted-on demos.

24 blocksEnglish + فارسیMarkdown shortcutsContext menuMulti-selectTables & bookmarksAsk AILive collaborationVue + React

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 markers
  • Offline resync

Undo that scales

History stores only the blocks a step changed — not the whole document — and undo never reverts a collaborator’s edits.

  • Block-level steps
  • Per-user undo
  • Rows keep identity

One core, two adapters

Shared block model, selection, and clipboard in @xproeditor/core — Vue and React stay behavior-identical.

  • @xproeditor/core
  • @xproeditor/vue
  • @xproeditor/react

Two toolbar modes

Sticky format toolbar, Notion-like floating bubble, both, or none — switch with one prop.

  • toolbar="floating"
  • toolbar="fixed"
  • / slash menu

Notion-like block chrome

Richer block context menu, multi-select with a floating edit popover, and two-stage Ctrl/⌘+A.

  • Block ··· menu
  • Multi-select popover
  • Reliable undo

Clipboard & Markdown

Drag or shift-select across blocks — including images and tables — then copy, cut, delete, or paste Markdown.

  • Multi-block copy/cut
  • Markdown paste
  • HTML + JSON clipboard

Tables, code & media

Table width, drag cell select, merge and style — plus code language/wrap/copy chrome, buttons, and web bookmarks.

  • Width + cell drag
  • Code wrap & copy
  • Bookmark links

Ask AI (pluggable)

Host supplies any LLM transport. Users get /ai, toolbar entry, streaming drafts, and Accept / Reject.

  • ai={{ transport }}
  • Improve / continue
  • No API keys in the package

Themeable CSS vars

Precompiled stylesheet. Restyle with --xpe-* variables — no Tailwind or Radix lock-in for consumers.

  • --xpe-primary
  • Dark via .xpe-dark
  • RTL ready

Markdown & keyboard shortcuts

Type **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 block

Any language, RTL first-class

Every 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 direction

Embeds & table of contents

Allow-listed embeds for YouTube, Vimeo, Loom, Figma, CodePen, CodeSandbox, Spotify, SoundCloud and Maps — plus a live, linked table of contents.

  • /embed
  • /table of contents
  • Anchored headings

Secure by default

Links, 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: blocked
  • Sanitized HTML export
  • Validated clipboard

Fast on long documents

Only 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 rows
  • Lazy highlight.js
  • ref.getMarkdown()

Toggles & structure

Collapsible toggles and toggle headings (H1–H3) nest content cleanly for docs, FAQs, and long posts.

  • /toggle
  • /toggle heading
  • Nested children
Use cases

Write once. Publish with DocRenderer.

Same Block[] document powers the editor and the public page. Pick a use case, edit, then switch to Published to see the read-only render.

Blog / magazine

Authors draft with / and Ask AI; readers get a clean article via DocRenderer.

Shipping a Notion-like editor in a weekend

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.

✍️Write in the editor → publish with DocRenderer. Same Block[] JSON, two surfaces.

What readers expect

•Clear headings and scannable lists
•Code samples that stay readable
•A CTA that is actually a button, not a plain link

A tiny example

TSX
// 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} />.

Get started

Install, drop in, optionally plug AI

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/react
import { 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}
    />
  )
}
FAQ

Questions teams ask before adopting

Is XProEditor free for commercial projects?

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.

Does it work with Vue and React?

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.

Can several people edit the same document in real time?

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.

How is the content stored?

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.

Do I need Tailwind, Radix or shadcn?

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.

Is it safe to render user content?

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.

Can I plug in my own AI model?

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.

Changelog

What’s new

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.

  1. @xproeditor/react 0.8.1

    Patch Changes

    •Columns: blocks no longer fall out of their column, and moving around a group follows the layout.
    •An image, video, table or any block added from the slash menu in a column stays in it, and so does a block whose type changes (slash menu, markdown shortcuts like # , code fence, ---, Turn into, the bubble toolbar, keyboard shortcuts): every path now keeps the block's indent, direction and column (placementProps).
    •ArrowUp/ArrowDown move within a column and leave the group at its edges; from above, ArrowDown enters the first column instead of selecting the group's header (columnArrowTarget).
    •An empty column shows "Column N: type, or press / for any block" (English and Persian), so a new group never looks like a gap.
    •Clicking below a document that ends with a group starts a new paragraph under the group instead of reusing the last column's placeholder.
    •Updated dependencies
    •@xproeditor/core@0.7.1
  2. @xproeditor/react 0.8.0

    Minor Changes

    •Add a columns block: 2 or 3 side-by-side columns of any blocks.
    •/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.
    •Enter keeps the column; Backspace and Delete never merge across a column edge; paste, drag and drop and 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.
    •Core: the flat-model helpers in columns.ts (createColumnsGroup, normalizeColumns, fitInsertedBlocks, setColumnCount, moveBlockToColumn, unwrapColumns, wrapInColumns, …), column-aware subtrees, collapsed toggles and list numbering, and dictionary strings in English and Persian.

    Patch Changes

    •Updated dependencies
    •@xproeditor/core@0.7.0
  3. @xproeditor/react 0.7.0

    Minor Changes

    •Code blocks: live syntax highlighting while you type, optional line numbers, a file name in the header, smart Enter (keeps indentation, indents after brackets), Mod+/ 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.
    •Real-time collaboration: pass a session from 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.

    Patch Changes

    •React 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.
    •Undo history now stores only the blocks each step changed (new 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.
    •Ask AI opens next to what you're working on: anchored to the caret, the selected text or the focused block (never the window corner when opened from the toolbar or block menu), measured instead of assuming a fixed size, flipped above when there's no room below, RTL-aware, scrollable when tall, and it follows its block on scroll. The placement logic is exported from core as placeFloating and resolveEditorAnchor. Toggle chevrons now rotate smoothly (one rotate() per state, 220 ms, reduced-motion aware) in the editor and DocRenderer.
    •Fix text selection inside code blocks, table cells and other fields of non-text blocks: dragging across lines no longer turns into a block selection that steals focus, and a drag inside one table cell stays a normal text selection. Pasting into a table cell no longer inserts raw HTML, and header cells are start-aligned. Code-block edits from Tab/Enter are applied synchronously, so fast typing right after them is never lost.
    •Updated dependencies
    •Updated dependencies
    •Updated dependencies
    •Updated dependencies
    •@xproeditor/core@0.6.0