Migrate from TinyMCE to Tiptap
Tiptap is a powerful alternative to TinyMCE. Migrating from TinyMCE to Tiptap is straightforward. This guide will walk you through the migration process step by step.
Content migration
HTML content compatibility
TinyMCE typically stores content as HTML, which makes migration to Tiptap seamless. Tiptap can directly use HTML content without any conversion:
// Your existing TinyMCE content
const existingContent = '<p>Hello <strong>world</strong>!</p>'
// Use directly in Tiptap
const editor = new Editor({
content: existingContent,
extensions: [StarterKit],
})
While HTML works perfectly, we recommend converting it to Tiptap's JSON format for better performance and readability. For batch conversion of existing content, use the HTML utility to convert HTML to JSON programmatically.
Editor setup
Installation
First, install Tiptap and its dependencies:
npm install @tiptap/core @tiptap/starter-kit
Tiptap supports all modern frontend UI frameworks like React and Vue. Follow the framework-specific installation instructions in our installation guides.
Basic editor setup
Replace your TinyMCE initialization with Tiptap:
// TinyMCE (before)
tinymce.init({
selector: '#editor',
plugins: 'lists link image table code',
toolbar: 'undo redo | bold italic | bullist numlist | link image',
})
// Tiptap (after)
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
const editor = new Editor({
element: document.querySelector('#editor'),
extensions: [StarterKit],
content: '<p>Hello World!</p>',
})
Extensions
Understanding Tiptap's extension system
Tiptap uses a modular extension system that resembles TinyMCE's plugin architecture. Each feature is an extension that can be configured independently.
The StarterKit is a bundle of all the basic extensions, and you can add or remove other extensions as needed.
Explore all available extensions in our extensions guide, or create your own to support custom functionality and HTML elements.
Common TinyMCE plugin equivalents
TinyMCE Plugin | Tiptap Extension | Notes |
---|---|---|
lists | BulletList , OrderedList , ListItem | Included in StarterKit |
link | Link | Included in StarterKit |
image | Image | Available separately |
table | Table | Available separately |
code | Code , CodeBlock | Included in StarterKit |
textcolor | TextStyle , Color | Available separately |
fontsize | TextStyle , FontSize | Available separately |
align | TextAlign | Available separately |
Extension configuration
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
import Image from '@tiptap/extension-image'
import Table from '@tiptap/extension-table'
import TableRow from '@tiptap/extension-table-row'
import TableHeader from '@tiptap/extension-table-header'
import TableCell from '@tiptap/extension-table-cell'
const editor = new Editor({
extensions: [
StarterKit,
// Add and configure extensions
Image.configure({
inline: true,
allowBase64: true,
}),
Table.configure({
resizable: true,
}),
TableRow,
TableHeader,
TableCell,
],
})
Custom extensions
For TinyMCE custom plugins, you can create custom Tiptap extensions. See our custom extensions guide for detailed instructions.
UI implementation
Toolbar implementation
TinyMCE's toolbar configuration translates to custom UI components in Tiptap:
// TinyMCE toolbar config
toolbar: 'undo redo | bold italic | bullist numlist'
// Tiptap equivalent (React example)
function Toolbar({ editor }) {
if (!editor) return null
return (
<div className="toolbar">
<button onClick={() => editor.chain().focus().undo().run()} disabled={!editor.can().undo()}>
Undo
</button>
<button onClick={() => editor.chain().focus().redo().run()} disabled={!editor.can().redo()}>
Redo
</button>
<button
onClick={() => editor.chain().focus().toggleBold().run()}
className={editor.isActive('bold') ? 'active' : ''}
>
Bold
</button>
<button
onClick={() => editor.chain().focus().toggleItalic().run()}
className={editor.isActive('italic') ? 'active' : ''}
>
Italic
</button>
</div>
)
}
Pre-built UI components
For faster development, consider using Tiptap's pre-built UI components:
- Explore our UI components for ready-to-use toolbar and menu components
- Check out practical examples in our default text editor example
Menu systems
TinyMCE's context menus can be replaced with Tiptap's BubbleMenu and FloatingMenu:
import { BubbleMenu } from '@tiptap/react'
function MyEditor() {
const editor = useEditor({
extensions: [StarterKit],
})
return (
<>
<EditorContent editor={editor} />
<BubbleMenu editor={editor}>
<button
onClick={() => editor.chain().focus().toggleBold().run()}
className={editor.isActive('bold') ? 'active' : ''}
>
Bold
</button>
<button
onClick={() => editor.chain().focus().toggleItalic().run()}
className={editor.isActive('italic') ? 'active' : ''}
>
Italic
</button>
</BubbleMenu>
</>
)
}
Migration checklist
Next steps
- Explore the extension overview to discover all available extensions
- Learn about custom extensions for advanced customization
- Check out our examples for implementation inspiration
- Review the performance guide for optimization tips