mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 19:29:02 +08:00
1.8 KiB
1.8 KiB
description | icon |
---|---|
Adds support for tasks (doesn’t make sure you actually complete them though). | list-check |
TaskList
This extension enables you to use task lists in the editor. They are rendered as <ul data-type="taskList">
. This implementation doesn’t require any framework, it’s using Vanilla JavaScript only.
Type [ ]
or [x]
at the beginning of a new line and it will magically transform to a task list.
Installation
npm install @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',
},
})
itemTypeName
Specify the list item name.
Default: 'taskItem'
TaskList.configure({
itemTypeName: 'taskItem',
})
Commands
toggleTaskList()
Toggle a task list.
editor.commands.toggleTaskList()
Keyboard shortcuts
Command | Windows/Linux | macOS |
---|---|---|
toggleTaskList() | Control Shift 9 |
Cmd Shift 9 |