Quickstart
Get up and running with Tiptap in just a few minutes. This guide will walk you through creating a basic editor with common formatting options.Make sure you’ve installed Tiptap before following this guide.
Basic Setup
Let’s create a simple editor with the starter kit. Choose your framework below:- React
- Vue 3
- Vanilla JS
Create the Editor
Here’s a minimal React example using Tiptap:What’s Happening?
1
Import the necessary packages
useEditor- A React hook to create and manage the editor instanceEditorContent- A React component that renders the editorStarterKit- A bundle of essential extensions
2
Initialize the editor with useEditor
The
useEditor hook takes a configuration object with:extensions- Array of extensions to enablecontent- Initial HTML content for the editor
3
Render the editor
The
EditorContent component takes the editor instance and renders the editing interfaceComplete Example with Toolbar
Here’s a more complete example with a formatting toolbar (fromdemos/src/Examples/Default/React/index.tsx):Cleanup
Always destroy the editor when the component unmounts to prevent memory leaks. TheuseEditor hook handles this automatically.Understanding Commands
Tiptap uses a chainable command API to modify the editor content:Common Commands
Checking Active States
UseisActive() to check if a formatting option is currently active:
Getting and Setting Content
Get Content
Set Content
Styling the Editor
Tiptap doesn’t include default styles. Add your own CSS to style the editor:Next Steps
Now that you have a working editor, explore more features:Add More Extensions
Browse and add more extensions like images, tables, and mentions
Create Custom Extensions
Learn how to build your own custom extensions
Add Collaboration
Enable real-time collaborative editing with Yjs
Explore Examples
See Tiptap in action with interactive examples
Need help? Join the Discord community or check out GitHub Discussions.