![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@tiptap/react
Advanced tools
@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.
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);
Draft.js is a framework for building rich text editors in React. It provides a set of immutable models and helper functions for managing editor state, but it is less feature-rich and customizable compared to Tiptap.
Slate is a completely customizable framework for building rich text editors. It provides a lot of flexibility and control over the editor's behavior and appearance, similar to Tiptap, but requires more boilerplate code.
Quill is a powerful, rich text editor that provides a simple API and a wide range of features out of the box. However, it is less customizable compared to Tiptap and is not built specifically for React.
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.
Documentation can be found on the Tiptap website.
Tiptap is open sourced software licensed under the MIT license.
FAQs
React components for tiptap
The npm package @tiptap/react receives a total of 532,138 weekly downloads. As such, @tiptap/react popularity was classified as popular.
We found that @tiptap/react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.