MIT LicensedAI, collaboration, everything — free forever

Rich text editor with AI & live collaboration

Notion-style blocks, streaming AI, Y.js collaboration, and a TipTap-inspired extension system — in a single ~45KB package. No ProseMirror. No license fees. Just install and ship.

  • AI generation
  • Live collaboration
  • Extension system
  • 969 tests

Under MIT License • Structure and idea developed by mina-massoud @2025

01

Quick Start

Three lines. Working editor. Import, render, ship. Installation packages coming soon.

02

AI Integration

Provider-agnostic AI that streams content directly into blocks. OpenAI, Anthropic, Ollama, or your own endpoint.

03

Real-time Collaboration

Same CRDT engine behind Figma and VS Code Live Share. Y.js-powered conflict resolution with cursor presence.

01 — Performance

Fast by architecture, not by accident

Engineered from the ground up for zero-lag editing at any scale.

2.8ms
Typing
0
Re-renders
14ms
Scroll

Per-Block Subscriptions

Each block subscribes only to its own slice of state. Type in block 5, blocks 1-4 and 6-200 don't know it happened.

Structural Sharing

State updates reuse unchanged references. React.memo skips re-renders automatically because the props literally haven't changed.

Direct DOM Reconciliation

Critical text operations bypass React's virtual DOM entirely, writing to the DOM directly for sub-millisecond response times.

App.tsx
import { CompactEditor } from "@/components/ui/rich-editor"

function App() {
  return (
    <CompactEditor
      initialContent={myContent}
      onChange={({ json, html }) => {
        saveToDatabase(json)
        updatePreview(html)
      }}
      minHeight="300px"
    />
  )
}
AI Provider
const myProvider: AIProvider = {
  generateStream: async function* (prompt) {
    const stream = await openai.chat
      .completions.create({
        model: "gpt-4",
        messages: [
          { role: "user", content: prompt }
        ],
        stream: true
      })
    for await (const chunk of stream) {
      yield chunk.choices[0]?.delta
        ?.content ?? ""
    }
  }
}

<CompactEditor ai={myProvider} />
02 — AI Integration

Your LLM, your editor

Provider-agnostic AI that streams content directly into blocks.

Provider Agnostic

OpenAI, Anthropic, Ollama, or your own endpoint — implement one interface.

Streaming Generation

AI responses stream token-by-token directly into editor blocks in real time.

Stream to Blocks

Markdown from the LLM is parsed into structured blocks as it arrives — headings, lists, code.

/ai Slash Command

Users type /ai followed by a prompt to generate content inline.

AI Styling

AI-powered formatting — emphasize key words, add bold/italic, mark code terms. Smart styling, not just rephrasing.

03 — Content Management

Programmatic control over everything

Read content in any format. Set content programmatically. Full API access to every aspect of the editor.

getJSON()

Structured tree for storage and re-hydration

getHTML()

Semantic HTML — no Tailwind, no framework artifacts

getMarkdown()

CommonMark-compatible Markdown output

getPlainText()

Raw text for search indexing and previews

useEditorAPI()
const api = useEditorAPI()

// Read content in any format
const json = api.getJSON()
const html = api.getHTML()
const markdown = api.getMarkdown()
const text = api.getPlainText()

// Programmatic control
api.setContent(savedDocument)
api.insertBlock({
  type: "heading-1",
  content: "Hello"
})

// State checks
api.isDirty()       // unsaved changes?
api.getBlockCount() // total blocks
Collaboration
import { CompactEditor, CollaborationProvider }
  from "@/components/ui/rich-editor"

function CollabEditor() {
  return (
    <CollaborationProvider
      roomId="my-document"
      serverUrl="wss://your-server.com"
      user={{
        name: "Mina",
        color: "#c8b4a0"
      }}>
      <CompactEditor />
    </CollaborationProvider>
  )
}
04 — Collaboration

Built for multiplayer

Same CRDT engine behind Figma and VS Code Live Share. No server-side resolution needed.

CRDT Conflict Resolution

Y.js-powered conflict-free replicated data types ensure every edit merges cleanly — even offline.

Cursor Presence

See where other users are typing in real time. Color-coded cursors with user names.

Simple Integration

Wrap your editor in CollaborationProvider, point it at a WebSocket server, and you're live.

05 — Extension System

Extend the editor your way

TipTap-inspired API with zero ProseMirror dependency. Build custom blocks, marks, and commands in minutes — not days.

Node.create() — Custom Blocks

Define new block types with styles, input rules, keyboard shortcuts, and slash-command registration. No schema language required.

Mark.create() — Inline Formatting

Add custom inline marks — highlights, annotations, comments — that integrate with the selection toolbar automatically.

Extension.create() — Behaviours

Register keyboard shortcuts, slash commands, and event hooks without defining new node types. Ship in one file.

3 Built-in Theme Presets

Notion, Minimal, and GitHub themes out of the box. Override any token with CSS variables — full dark mode support included.

Custom Extension
import { Node, StarterKit } from "@/components/ui/rich-editor"

// Define a custom callout block
const Callout = Node.create({
  name: 'callout',
  nodeType: 'callout',
  group: 'block',
  addStyles: () =>
    'bg-blue-50 border-l-4 border-blue-500 p-4 rounded',
  addInputRules: () => [{
    find: /^!!! (.+)$/,
    handler: (match, ctx) => {
      // Convert "!!! text" → callout block
      return true
    }
  }],
})

<CompactEditor
  extensions={[StarterKit, Callout]}
/>
06 — Developer Experience

Built by developers, for developers

Every feature is designed to save you time and reduce complexity.

01dnd

Drag & Drop

Block-level reordering with visual drop indicators, nested block support, and touch-friendly handles for tablet users.

02tbl

Table System

Full table editing — add and remove rows and columns, cell selection, and clean HTML table output.

03img

Image System

Drag-to-upload, paste from clipboard, URL embedding, resize handles, alt text, and caption support.

04md

Markdown Shortcuts

Type # space for headings, ** for bold, ` for code, > for quotes, - for lists. Zero learning curve.

05sel

Selection Toolbar

Floating toolbar appears on text selection with bold, italic, underline, strikethrough, code, link, and color options.

06tpl

Template System

Pre-built document templates — blog post, meeting notes, project brief — that users can apply with one click.

07kbd

Keyboard Shortcuts

Comprehensive shortcut system: Ctrl+B for bold, Ctrl+K for links, Ctrl+Shift+1-3 for headings, Tab for indent.

08a11y

Accessibility

ARIA roles and labels on all interactive elements. Full keyboard navigation. Screen reader announcements for block operations.

09ts

TypeScript-First

100% TypeScript. Every prop, callback, type, and hook is fully typed. The type system is the documentation.

10css

Style Isolation

All editor styles are scoped. Your app's CSS won't break the editor. The editor's CSS won't break your app.

1145k

Lightweight

~45KB gzipped with zero ProseMirror dependency. TipTap ships 120KB+ with mandatory ProseMirror core. Mina's extension system adds zero overhead.

12tst

969 Tests

Comprehensive test suite: 759 unit tests (Vitest) and 210 E2E tests (Playwright) covering block operations, keyboard handling, serialization, and edge cases.

13ext

Extension System

Build custom blocks, marks, and commands with Extension.create(), Node.create(), and Mark.create(). TipTap-inspired API, zero ProseMirror dependency.

14thm

Theme Presets

3 built-in theme presets (Notion, Minimal, GitHub) — or create your own with CSS variables. Full dark mode support.

07 — FAQ

Frequently asked questions

What is Mina Rich Editor?

Mina Rich Editor is a free, open-source React block-based rich text editor that provides Notion-style block editing, built-in AI content generation, and Y.js-powered real-time collaboration in a single ~45KB gzipped package with zero ProseMirror dependency. It is built with TypeScript, shadcn/ui, and Tailwind CSS, and is MIT-licensed for commercial use.

How does Mina Rich Editor compare to TipTap?

Mina Rich Editor is ~45KB gzipped versus TipTap's 120KB+, requires no ProseMirror dependency, and includes built-in AI streaming, real-time collaboration, an extension system with Node.create()/Mark.create()/Extension.create(), and 3 theme presets — all at no cost. TipTap requires ProseMirror as a mandatory peer dependency, charges for collaboration and AI features, and offers no built-in themes. Mina Rich Editor is fully MIT-licensed with no commercial restrictions.

What block types does Mina Rich Editor support?

Mina Rich Editor supports 15+ block types including paragraphs, headings (H1–H4), ordered and unordered lists, code blocks, blockquotes, tables with row and column manipulation, images with drag-to-upload and resize, horizontal rules, toggle blocks, and cover images. All block types support drag-and-drop reordering and nesting.

Does Mina Rich Editor support AI content generation?

Yes. Mina Rich Editor has built-in AI integration that works with OpenAI, Anthropic Claude, Google Gemini, Ollama, or any custom endpoint. AI responses stream token-by-token directly into editor blocks, and Markdown output is parsed into structured blocks (headings, lists, code) as it arrives. Users can type /ai followed by a prompt to generate content inline.

Is Mina Rich Editor free to use?

Yes. Mina Rich Editor is completely free and open-source under the MIT license. There are no commercial restrictions, no paid tiers, and no feature gating. AI integration, real-time collaboration, and all 15+ block types are included at no cost.

Does Mina Rich Editor support real-time collaboration?

Yes. Mina Rich Editor includes Y.js CRDT-powered real-time collaboration with cursor presence, user name labels, and conflict-free merging — even for offline edits. Integration requires wrapping the editor in a CollaborationProvider and pointing it at a WebSocket server.

What export formats does Mina Rich Editor support?

Mina Rich Editor exports content as JSON (structured tree for storage), semantic HTML (no Tailwind or framework artifacts), CommonMark-compatible Markdown, and plain text (for search indexing and previews). All formats are available via simple API calls: getJSON(), getHTML(), getMarkdown(), and getPlainText().

Ready to build?

No ProseMirror dependency. Simple, powerful extensions. No PhD required.

DocsDemoGitHubMIT License