ScriptsApr 3, 2026·2 min read

Tiptap — Headless Rich Text Editor Framework

Build custom rich text editors with a modular, extensible framework on ProseMirror. Works with React, Vue, and more. 36K+ stars.

TL;DR
Tiptap is a headless, modular rich text editor on ProseMirror for React and Vue.
§01

What it is

Tiptap is a headless rich text editor framework built on top of ProseMirror. It provides the editing logic -- content model, input rules, keyboard shortcuts, collaboration -- while letting you build your own UI. It works with React, Vue, Svelte, and vanilla JavaScript. Extensions add features like tables, mentions, code blocks, and AI autocompletion.

It targets developers building content management systems, documentation tools, email composers, and AI-powered writing interfaces that need full control over the editor's appearance and behavior.

§02

How it saves time or tokens

Tiptap gives you a production-ready editing engine without building one from scratch. ProseMirror is powerful but low-level; Tiptap wraps it with a developer-friendly API and extension system. For AI applications, the extension architecture lets you add AI-powered features (autocomplete, rewriting, summarization) as plugins without modifying the core editor.

§03

How to use

  1. Install for React:
npm install @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/react
  1. Create a basic editor:
import { useEditor, EditorContent } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';

function MyEditor() {
    const editor = useEditor({
        extensions: [StarterKit],
        content: '<p>Start writing...</p>'
    });
    
    return <EditorContent editor={editor} />;
}
  1. Add a toolbar:
function Toolbar({ editor }) {
    return (
        <div>
            <button onClick={() => editor.chain().focus().toggleBold().run()}>Bold</button>
            <button onClick={() => editor.chain().focus().toggleItalic().run()}>Italic</button>
            <button onClick={() => editor.chain().focus().toggleCodeBlock().run()}>Code</button>
        </div>
    );
}
§04

Example

import { useEditor, EditorContent } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';
import Placeholder from '@tiptap/extension-placeholder';
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight';

function AIEditor() {
    const editor = useEditor({
        extensions: [
            StarterKit,
            Placeholder.configure({ placeholder: 'Start writing or press / for AI...' }),
            CodeBlockLowlight.configure({ lowlight })
        ],
        content: '',
        onUpdate: ({ editor }) => {
            console.log('Content:', editor.getJSON());
        }
    });
    
    const insertAIText = async () => {
        const selected = editor.state.doc.textBetween(
            editor.state.selection.from,
            editor.state.selection.to
        );
        // Call your AI API to rewrite/expand the selected text
        const improved = await aiRewrite(selected);
        editor.chain().focus().insertContent(improved).run();
    };
    
    return (
        <div>
            <button onClick={insertAIText}>AI Rewrite</button>
            <EditorContent editor={editor} />
        </div>
    );
}
§05

Related on TokRepo

§06

Common pitfalls

  • Tiptap is headless, meaning you must build or style the toolbar UI yourself. The starter kit provides editing logic but no default toolbar component.
  • ProseMirror's document model has a learning curve. Custom node types and marks require understanding the schema system.
  • Real-time collaboration requires a backend (Hocuspocus or Y.js provider). The collaboration extension does not work without a WebSocket server.

Frequently Asked Questions

What is a headless editor?+

A headless editor provides the editing logic (content model, input handling, state management) without any pre-built UI. You build your own toolbar, menus, and styling. This gives complete control over appearance and behavior, unlike opinionated editors like CKEditor or TinyMCE.

Does Tiptap support collaboration?+

Yes. Tiptap has a collaboration extension built on Y.js (CRDT-based). It enables real-time collaborative editing where multiple users edit the same document simultaneously. You need a WebSocket backend like Hocuspocus to sync changes between clients.

Can I add AI features to Tiptap?+

Yes. Tiptap's extension architecture lets you add AI-powered features as custom extensions. You can build slash commands for AI autocomplete, selection-based rewriting, and inline suggestions. The editor provides APIs to read selected text and insert generated content.

Which frameworks does Tiptap support?+

Tiptap provides official packages for React, Vue 2, Vue 3, Svelte, and vanilla JavaScript. Each framework integration provides hooks or composables for editor lifecycle management. The core logic is framework-agnostic.

Is Tiptap free for commercial use?+

Tiptap's core and community extensions are open-source under the MIT license. Tiptap also offers paid pro extensions (AI, comments, file handling) and a cloud service for collaboration. The open-source version is fully functional for most use cases.

Citations (3)
🙏

Source & Thanks

Created by Ueberdosis. Licensed under MIT.

tiptap — ⭐ 36,000+

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets