tiptap/docs/api/nodes/task-list.md
2021-10-14 21:20:21 +02:00

1.7 KiB
Raw Blame History

description icon
Adds support for tasks (doesnt make sure you actually complete them though). list-check

TaskList

Version Downloads

This extension enables you to use task lists in the editor. They are rendered as <ul data-type="taskList">. This implementation doesnt require any framework, its using Vanilla JavaScript only.

Type [ ]  or [x]  at the beginning of a new line and it will magically transform to a task list.

Installation

# with npm
npm install @tiptap/extension-task-list @tiptap/extension-task-item

# with Yarn
yarn add @tiptap/extension-task-list @tiptap/extension-task-item

This extension requires the TaskItem extension.

Settings

HTMLAttributes

Custom HTML attributes that should be added to the rendered HTML tag.

TaskList.configure({
  HTMLAttributes: {
    class: 'my-custom-class',
  },
})

Commands

toggleTaskList()

Toggle a task list.

editor.commands.toggleTaskList()

Keyboard shortcuts

Command Windows/Linux macOS
toggleTaskList() Control Shift 9 Cmd Shift 9

Source code

packages/extension-task-list/

Usage