Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-task-item

Package Overview
Dependencies
Maintainers
4
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-task-item

task item extension for tiptap

  • 2.1.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
261K
increased by24.28%
Maintainers
4
Weekly downloads
 
Created

What is @tiptap/extension-task-item?

@tiptap/extension-task-item is an extension for the Tiptap editor that allows you to create and manage task items (checkboxes) within your rich text editor. It provides a way to add interactive checkboxes to your content, making it useful for creating to-do lists, task management applications, and other similar functionalities.

What are @tiptap/extension-task-item's main functionalities?

Creating Task Items

This code demonstrates how to import and use the TaskItem extension in a Tiptap editor instance. By including TaskItem in the extensions array, you enable the creation of task items within the editor.

import TaskItem from '@tiptap/extension-task-item';

const editor = new Editor({
  extensions: [
    TaskItem,
  ],
});

Customizing Task Items

This code shows how to configure the TaskItem extension to allow nested task items. The `nested` option is set to true, enabling the creation of sub-tasks within a task list.

import TaskItem from '@tiptap/extension-task-item';

const editor = new Editor({
  extensions: [
    TaskItem.configure({
      nested: true,
    }),
  ],
});

Handling Task Item State

This code demonstrates how to handle the state of task items within the editor. By listening to the 'update' event, you can get the current state of the editor content in JSON format, which includes the state of the task items (checked or unchecked).

import TaskItem from '@tiptap/extension-task-item';

const editor = new Editor({
  extensions: [
    TaskItem,
  ],
});

editor.on('update', ({ editor }) => {
  const json = editor.getJSON();
  console.log(json);
});

Other packages similar to @tiptap/extension-task-item

Keywords

FAQs

Package last updated on 15 Sep 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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc