What is @tiptap/extension-strike?
@tiptap/extension-strike is an extension for the Tiptap editor that provides functionality for strikethrough text formatting. It allows users to apply and remove strikethrough styling to selected text within the editor.
What are @tiptap/extension-strike's main functionalities?
Add Strikethrough Formatting
This code demonstrates how to add the strikethrough extension to a Tiptap editor instance. The content includes an example of text with strikethrough formatting.
import { Strike } from '@tiptap/extension-strike';
import { Editor } from '@tiptap/core';
const editor = new Editor({
extensions: [
Strike,
],
content: '<p>This is a <s>strikethrough</s> example.</p>',
});
Toggle Strikethrough Formatting
This code shows how to toggle strikethrough formatting on the selected text in the editor. If the selected text already has strikethrough, it will be removed; otherwise, it will be applied.
editor.chain().focus().toggleStrike().run();
Other packages similar to @tiptap/extension-strike
prosemirror-schema-basic
The prosemirror-schema-basic package provides a basic schema for ProseMirror, including support for strikethrough formatting. It is more low-level compared to @tiptap/extension-strike and requires more setup to integrate with an editor.
quill
Quill is a rich text editor that includes built-in support for strikethrough formatting. It offers a more comprehensive set of features out of the box compared to @tiptap/extension-strike, which is a more focused extension for Tiptap.
@tiptap/extension-strike
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.