Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@tiptap/starter-kit
Advanced tools
@tiptap/starter-kit is a comprehensive toolkit for building rich text editors with Tiptap, a headless, framework-agnostic text editor built on ProseMirror. It provides a set of pre-configured extensions and features to quickly set up a functional and customizable text editor.
Basic Setup
This code sets up a basic Tiptap editor with the StarterKit extension, which includes essential features like bold, italic, and paragraph formatting.
import { Editor } from '@tiptap/core';
import StarterKit from '@tiptap/starter-kit';
const editor = new Editor({
element: document.querySelector('#editor'),
extensions: [StarterKit],
});
Custom Extensions
This example demonstrates how to add custom extensions to the Tiptap editor alongside the StarterKit, allowing for extended functionality.
import { Editor } from '@tiptap/core';
import StarterKit from '@tiptap/starter-kit';
import CustomExtension from './CustomExtension';
const editor = new Editor({
element: document.querySelector('#editor'),
extensions: [StarterKit, CustomExtension],
});
Event Handling
This code snippet shows how to handle events in the Tiptap editor, such as logging the updated content whenever the editor's content changes.
import { Editor } from '@tiptap/core';
import StarterKit from '@tiptap/starter-kit';
const editor = new Editor({
element: document.querySelector('#editor'),
extensions: [StarterKit],
onUpdate: ({ editor }) => {
console.log('Content updated:', editor.getHTML());
},
});
Quill is a powerful, free, open-source WYSIWYG editor built for the modern web. It offers a rich API and a modular architecture, making it highly customizable. Compared to @tiptap/starter-kit, Quill is more opinionated and comes with a default UI, whereas Tiptap is headless and more flexible.
Slate is a completely customizable framework for building rich text editors. It provides a set of tools to create complex editors with a focus on extensibility and control over the rendering process. Unlike @tiptap/starter-kit, Slate requires more setup and configuration but offers greater flexibility in terms of customization.
Draft.js is a JavaScript rich text editor framework, built and maintained by Facebook. It provides a set of React components and an immutable model for managing editor state. Draft.js is similar to @tiptap/starter-kit in terms of providing a robust foundation for building text editors, but it is more tightly coupled with 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
starter kit for tiptap
We found that @tiptap/starter-kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.