Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@tiptap/extension-task-list
Advanced tools
@tiptap/extension-task-list is an extension for the Tiptap editor that allows you to add and manage task lists within your rich text editor. It provides functionality to create, edit, and manage task lists, making it easier to handle to-do lists and similar content within your editor.
Create Task List
This code demonstrates how to create a task list using the @tiptap/extension-task-list package. It initializes the Tiptap editor with the TaskList and TaskItem extensions and sets the initial content to a task list with two items.
import TaskList from '@tiptap/extension-task-list';
import TaskItem from '@tiptap/extension-task-item';
import { Editor } from '@tiptap/core';
const editor = new Editor({
extensions: [
TaskList,
TaskItem,
],
content: '<ul data-type="taskList"><li data-checked="false">Task 1</li><li data-checked="true">Task 2</li></ul>',
});
Toggle Task Completion
This code demonstrates how to toggle the completion status of a task item within a task list. The `toggleTaskItem` method is used to change the checked state of a task item.
editor.chain().focus().toggleTaskItem({ id: 'task-item-id' }).run();
Add New Task Item
This code demonstrates how to add a new task item to an existing task list. The `insertContent` method is used to insert a new task item with the specified content.
editor.chain().focus().insertContent('<li data-type="taskItem" data-checked="false">New Task</li>').run();
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
task list extension for tiptap
The npm package @tiptap/extension-task-list receives a total of 142,010 weekly downloads. As such, @tiptap/extension-task-list popularity was classified as popular.
We found that @tiptap/extension-task-list 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
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.