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.
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.
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.
How to use
- Install for React:
npm install @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/react
- 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} />;
}
- 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>
);
}
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>
);
}
Related on TokRepo
- AI tools for content -- Content creation and editing tools
- AI tools for coding -- Developer tools and frameworks
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
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.
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.
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.
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.
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)
- Tiptap GitHub Repository— Tiptap is a headless editor framework built on ProseMirror
- Tiptap Documentation— Tiptap supports React, Vue, Svelte, and vanilla JavaScript
- ProseMirror Documentation— ProseMirror provides the foundation for rich text editing
Related on TokRepo
Source & Thanks
Created by Ueberdosis. Licensed under MIT.
tiptap — ⭐ 36,000+
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.