Skip to main content
Tiptap provides first-class support for React with hooks, components, and utilities that integrate seamlessly with React’s ecosystem.

Installation

1

Install the packages

Install the React package along with the core package and any extensions you need:
2

Import and use

Import the necessary components and hooks in your React component:

Core Concepts

useEditor Hook

The useEditor hook is the primary way to create and manage an editor instance in React. It handles the editor lifecycle automatically.

Type Signature

Basic Usage

SSR Configuration

For server-side rendering (Next.js, Remix, etc.), you must set immediatelyRender to false:

Performance Optimization

For better performance, disable transaction re-renders and use useEditorState instead:

EditorContent Component

The EditorContent component renders the actual editor interface.

Usage Example

New Tiptap Component API

Tiptap 3.18+ introduces a new component-based API that provides a cleaner, more React-idiomatic way to build editors.

Tiptap Provider Component

The Tiptap component provides the editor instance via context, making it available to all child components.

useTiptap Hook

Access the editor instance from any component inside the Tiptap provider:

useTiptapState Hook

Select specific editor state slices for optimized re-renders:

Complete Working Example

Event Handlers

Handle editor events through the useEditor options:

Dependencies Array

The second parameter of useEditor accepts a dependencies array, similar to useEffect. When dependencies change, the editor is recreated:

TypeScript Support

Tiptap has full TypeScript support with comprehensive type definitions:

Advanced: Custom Node Views

Create React components as custom node views:
Bubble and floating menus are now separate imports to keep @floating-ui/dom optional:

Next Steps

Extensions

Explore available extensions to enhance your editor

Commands

Learn about editor commands and chains

Styling

Customize the editor’s appearance

Node Views

Create interactive custom nodes