Socket
Socket
Sign inDemoInstall

@tiptap/react

Package Overview
Dependencies
Maintainers
4
Versions
227
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/react

React components for tiptap


Version published
Maintainers
4
Install size
Created

Package description

What is @tiptap/react?

@tiptap/react is a headless, framework-agnostic text editor built on top of ProseMirror. It provides a highly customizable and extensible rich text editor for React applications.

What are @tiptap/react's main functionalities?

Basic Editor Setup

This code sets up a basic Tiptap editor with the StarterKit extension, which includes common features like bold, italic, and lists.

import React from 'react';
import { useEditor, EditorContent } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';

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

  return <EditorContent editor={editor} />;
};

export default Tiptap;

Custom Extensions

This code demonstrates how to create a custom extension for Tiptap. The custom extension defines a new node type that can be used within the editor.

import { Node, mergeAttributes } from '@tiptap/core';

const CustomExtension = Node.create({
  name: 'customExtension',
  group: 'block',
  content: 'inline*',
  parseHTML() {
    return [{ tag: 'custom-extension' }];
  },
  renderHTML({ HTMLAttributes }) {
    return ['custom-extension', mergeAttributes(HTMLAttributes), 0];
  },
});

export default CustomExtension;

Collaboration

This code sets up a collaborative editing environment using Tiptap and Yjs with WebRTC. Multiple users can edit the same document in real-time.

import { Collaboration } from '@tiptap/extension-collaboration';
import { WebrtcProvider } from 'y-webrtc';

const editor = useEditor({
  extensions: [
    StarterKit,
    Collaboration.configure({
      document: ydoc,
    }),
  ],
});

const provider = new WebrtcProvider('your-room-name', ydoc);

Other packages similar to @tiptap/react

Readme

Source

@tiptap/react

Version Downloads License Sponsor

Introduction

Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.

Official Documentation

Documentation can be found on the Tiptap website.

License

Tiptap is open sourced software licensed under the MIT license.

Keywords

FAQs

Package last updated on 30 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc