Convert Figma logo to code with AI

ueberdosis logotiptap

The headless rich text editor framework for web artisans.

28,405
2,365
28,405
545

Top Related Projects

The ProseMirror WYSIWYM editor

44,368

Quill is a modern WYSIWYG editor built for compatibility and extensibility

20,360

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.

30,241

A completely customizable framework for building rich text editors. (Currently in beta.)

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.

17,875

Shared data types for building collaborative software

Quick Overview

Tiptap is a headless, framework-agnostic rich text editor for the web. It's built on top of ProseMirror, providing a powerful and flexible foundation for creating customizable text editing experiences. Tiptap offers a wide range of features and extensions, making it suitable for various use cases, from simple text inputs to complex document editors.

Pros

  • Highly customizable and extensible
  • Framework-agnostic, can be used with any JavaScript framework
  • Strong TypeScript support
  • Active development and community support

Cons

  • Steeper learning curve compared to some other rich text editors
  • Requires more setup and configuration for advanced features
  • Documentation can be overwhelming for beginners
  • Some advanced features are only available in the paid Pro version

Code Examples

  1. Basic editor setup:
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

new Editor({
  element: document.querySelector('.editor'),
  extensions: [
    StarterKit,
  ],
  content: '<p>Hello World!</p>',
})
  1. Adding a custom extension:
import { Extension } from '@tiptap/core'

const CustomExtension = Extension.create({
  name: 'customExtension',
  
  addKeyboardShortcuts() {
    return {
      'Mod-j': () => console.log('Custom shortcut triggered!'),
    }
  },
})

new Editor({
  extensions: [
    StarterKit,
    CustomExtension,
  ],
})
  1. Using the editor with React:
import { useEditor, EditorContent } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'

const MyEditor = () => {
  const editor = useEditor({
    extensions: [StarterKit],
    content: '<p>Hello React!</p>',
  })

  return <EditorContent editor={editor} />
}

Getting Started

To get started with Tiptap, follow these steps:

  1. Install Tiptap and its dependencies:
npm install @tiptap/core @tiptap/starter-kit
  1. Create a basic editor instance:
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

const editor = new Editor({
  element: document.querySelector('#editor'),
  extensions: [
    StarterKit,
  ],
  content: '<p>Hello Tiptap!</p>',
})
  1. Add the editor to your HTML:
<div id="editor"></div>

This setup provides a basic rich text editor with common features. You can further customize and extend the editor based on your specific requirements.

Competitor Comparisons

The ProseMirror WYSIWYM editor

Pros of ProseMirror

  • More flexible and customizable, allowing for deeper control over the editor's behavior
  • Better suited for complex document structures and advanced editing features
  • Larger ecosystem with a wide range of plugins and extensions

Cons of ProseMirror

  • Steeper learning curve, requiring more time and effort to implement
  • Less opinionated, which can lead to more decision-making and potential inconsistencies
  • Requires more boilerplate code to get started

Code Comparison

ProseMirror:

import {EditorState} from "prosemirror-state"
import {EditorView} from "prosemirror-view"
import {Schema} from "prosemirror-model"

const schema = new Schema({...})
const state = EditorState.create({schema})
const view = new EditorView(document.body, {state})

Tiptap:

import {Editor} from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

new Editor({
  element: document.querySelector('.element'),
  extensions: [StarterKit],
})
44,368

Quill is a modern WYSIWYG editor built for compatibility and extensibility

Pros of Quill

  • Mature and stable project with a longer history
  • Extensive documentation and large community support
  • Simpler API and easier learning curve for beginners

Cons of Quill

  • Less flexible and customizable compared to Tiptap
  • Limited support for collaborative editing features
  • Slower development pace and fewer recent updates

Code Comparison

Quill initialization:

var quill = new Quill('#editor', {
  theme: 'snow'
});

Tiptap initialization:

new Editor({
  element: document.querySelector('#editor'),
  extensions: [
    StarterKit,
  ],
})

Both Quill and Tiptap are popular rich text editors for web applications. Quill offers a more straightforward approach with its simple API and extensive documentation, making it easier for beginners to get started. However, Tiptap provides greater flexibility and customization options, allowing developers to create more tailored editing experiences.

Tiptap's modular architecture and use of ProseMirror as its foundation give it an edge in terms of extensibility and collaborative editing capabilities. On the other hand, Quill's maturity and established community provide a sense of stability and reliability for projects that don't require advanced customization.

Ultimately, the choice between Quill and Tiptap depends on the specific needs of your project, with Quill being suitable for simpler implementations and Tiptap excelling in more complex, customized scenarios.

20,360

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.

Pros of Lexical

  • More lightweight and performant, especially for large documents
  • Offers a headless core, allowing for greater flexibility in UI implementation
  • Backed by Facebook, potentially ensuring long-term support and development

Cons of Lexical

  • Newer project with a smaller community and ecosystem compared to Tiptap
  • Less out-of-the-box features and extensions, requiring more custom development
  • Steeper learning curve, especially for developers new to content-editable concepts

Code Comparison

Tiptap:

import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

new Editor({
  element: document.querySelector('.editor'),
  extensions: [StarterKit],
})

Lexical:

import { createEditor } from 'lexical'
import { RichTextPlugin } from '@lexical/rich-text'

const editor = createEditor()
editor.registerPlugin(RichTextPlugin)

Both Tiptap and Lexical are powerful rich text editing frameworks, but they cater to different needs. Tiptap offers a more complete solution out-of-the-box with a wide range of extensions, making it easier for quick implementation. Lexical, on the other hand, provides a more flexible and performant core, allowing for greater customization but requiring more initial setup. The choice between the two depends on project requirements, performance needs, and development preferences.

30,241

A completely customizable framework for building rich text editors. (Currently in beta.)

Pros of Slate

  • More flexible and customizable, allowing for complex document structures
  • Better suited for building custom, domain-specific editors
  • Provides a lower-level API, giving developers more control over the editing experience

Cons of Slate

  • Steeper learning curve due to its lower-level nature
  • Less out-of-the-box functionality compared to Tiptap
  • Requires more setup and configuration for basic editing features

Code Comparison

Slate example:

const editor = withReact(createEditor())
const [value, setValue] = useState(initialValue)

return (
  <Slate editor={editor} value={value} onChange={value => setValue(value)}>
    <Editable />
  </Slate>
)

Tiptap example:

const editor = useEditor({
  extensions: [StarterKit],
  content: '<p>Hello World!</p>',
})

return <EditorContent editor={editor} />

Both Slate and Tiptap are powerful rich text editing frameworks for React applications. Slate offers more flexibility and control, making it suitable for complex, custom editors. However, it requires more setup and has a steeper learning curve. Tiptap, on the other hand, provides a more user-friendly API with out-of-the-box functionality, making it easier to implement basic rich text editing features quickly.

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.

Pros of tui.editor

  • More comprehensive out-of-the-box features, including Markdown support and various plugins
  • Better documentation and examples for quick implementation
  • Larger community and more frequent updates

Cons of tui.editor

  • Heavier bundle size due to more built-in features
  • Less flexibility for customization compared to Tiptap's modular approach
  • Steeper learning curve for developers who need specific functionality

Code Comparison

tui.editor:

import Editor from '@toast-ui/editor';

const editor = new Editor({
  el: document.querySelector('#editor'),
  initialEditType: 'markdown',
  previewStyle: 'vertical'
});

Tiptap:

import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

const editor = new Editor({
  element: document.querySelector('#editor'),
  extensions: [StarterKit],
})

Both editors offer straightforward initialization, but Tiptap's modular approach allows for more granular control over included features. tui.editor provides more options in the initial configuration, reflecting its comprehensive nature. Tiptap's simplicity makes it easier to get started with basic editing functionality, while tui.editor's initial setup demonstrates its rich feature set out of the box.

17,875

Shared data types for building collaborative software

Pros of yjs

  • Designed for real-time collaboration and synchronization
  • Supports a wide range of data types beyond text (e.g., XML, JSON)
  • Offers offline support and conflict resolution

Cons of yjs

  • Steeper learning curve due to its more complex architecture
  • Less focused on rich text editing specifically
  • Requires additional setup for integration with UI frameworks

Code comparison

yjs:

import * as Y from 'yjs'
import { WebsocketProvider } from 'y-websocket'

const ydoc = new Y.Doc()
const provider = new WebsocketProvider('ws://localhost:1234', 'my-room', ydoc)
const ytext = ydoc.getText('mytext')

ytext.observe(event => {
  console.log('Text changed:', ytext.toString())
})

tiptap:

import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'

new Editor({
  element: document.querySelector('.editor'),
  extensions: [StarterKit],
  content: '<p>Hello World!</p>',
  onUpdate: ({ editor }) => {
    console.log('Content updated:', editor.getHTML())
  }
})

While yjs focuses on data synchronization and collaboration, tiptap provides a more straightforward API for rich text editing. yjs offers greater flexibility for various data types, but tiptap is more specialized for text editing and easier to integrate into existing projects.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Tiptap Editor

The Tiptap Editor is a headless, framework-agnostic rich text editor that's customizable and extendable through extensions. Its headless nature means it comes without a set user interface, offering full design freedom (for a jumpstart, see linked UI templates below). Tiptap is based on the highly reliable ProseMirror library.

Tiptap Editor is complemented by the collaboration open-source backend Hocuspocus. Both the Editor and Hocuspocus form the foundation of the Tiptap Suite.

Build Status Version Downloads License Chat Sponsor

How does the Tiptap Editor work?

  • Headless Framework: Tiptap does not rely on a user interface. So there is no need for class overrides or code hacks. If you do need an example UI feel free to browse our UI templates linked below.
  • Framework-agnostic: The Tiptap Editor is designed to work across different frontend frameworks. This means whether you're using Vue, React, or plain JavaScript, Tiptap integrates without compatibility issues.
  • Extension based: Extensions in Tiptap allow for a tailored editing experience, from simple text styling to advanced features like drag-and-drop block editing. You have the option to choose from over 100 extensions available in the documentation and community to enhance your editor's functionality.
  • Customize your UX: The editor was built to give you control to define your own extensions and nodes.

Editor Pro Extensions

The Pro Extensions are a set of advanced functionalities that enhance the capabilities of the Tiptap Editor. They are additional features that can be integrated into the base editor to provide more sophisticated editing options.

Key functionalities include collaborative editing, which allows multiple users to edit documents simultaneously, drag-and-drop file management for easier handling of documents and media, and unique node ID assignment. Review the docs right here.

Pro Extensions are free with a Tiptap account. Once signed up, review the guide in your account.

Make your editor collaborative

Interested in collaborative editing? Check out our open-source package Hocuspocus - a collaboration backend built around the CRDT power of Yjs. Hocuspocus serves as the backbone for the Tiptap Suite.

Documentation

For more detailed information, make sure to check out our documentation. If you encounter any problems or have suggestions for our system, please open an issue.

Examples, CodeSandbox and UI Templates

Have a look at the examples to see Tiptap in action or review and fork our codesandboxes.

About Tiptap

Tiptap is a collection of developer components based on open-source technology, forming the basis of our advanced, paid features. It includes the open-source editor component, collaboration features, Content AI, and Tiptap Cloud. We are developing open-source products that also shape our paid features. We're committed to improving both, ensuring quality and reliability in every update.

For more details, visit the Tiptap documentation or website.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discuss Tiptap on GitHub

Sponsors 💖


Complish

Storyblok

PostHog

Reflect

Ziff Media

Basewell

Poggio

iFixit, ApostropheCMS, Novadiscovery, Omics Data Automation, Flow Mobile, DocIQ and hundreds of awesome individuals.

Contributing

Feel like adding some magic of your own to Tiptap Editor Core? We welcome contributions! Please see our CONTRIBUTING guidelines for how to get started.

Contributors

Sam Willis, Brian Hung, Dirk Holtwick, Sam Duvall, Christoph Flathmann, Erick Wilder, Marius Tolzmann, jjangga0214, Maya Nedeljkovich, Ryan Bliss, Gregor and many more.

License

The MIT License (MIT). Please see License File for more information.

NPM DownloadsLast 30 Days