2020-10-30 20:19:06 +08:00
# TaskList
2020-11-04 00:05:27 +08:00
This extension enables you to use task lists in the editor. They are rendered as `<ul data-type="task_list">` . This implementation doesn’ t require any framework, it’ s using plain JavaScript only.
Type < code > [ ] < / code > or < code > [x] < / code > at the beginning of a new line and it will magically transform to a task list.
2020-10-30 20:19:06 +08:00
## Installation
::: warning Use with TaskItem
2020-11-04 00:05:27 +08:00
This extension requires the [`TaskItem` ](/api/nodes/task-item ) extension.
2020-10-30 20:19:06 +08:00
:::
```bash
2020-11-04 00:05:27 +08:00
# with npm
2020-10-30 20:19:06 +08:00
npm install @tiptap/extension -task-list @tiptap/extension -task-item
2020-11-04 00:05:27 +08:00
# with Yarn
2020-10-30 20:19:06 +08:00
yarn add @tiptap/extension -task-list @tiptap/extension -task-item
```
## Settings
2020-11-18 19:12:34 +08:00
| Option | Type | Default | Description |
| -------------- | -------- | ------- | --------------------------------------------------------------------- |
| HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
2020-10-30 20:19:06 +08:00
## Commands
2020-11-03 23:43:35 +08:00
| Command | Parameters | Description |
| -------- | ---------- | ------------------- |
| taskList | — | Toggle a task list. |
2020-10-30 20:19:06 +08:00
2020-11-19 08:16:10 +08:00
## Keyboard shortcuts
* Windows/Linux: `Control` `Shift` `L`
* macOS: `Cmd` `Shift` `L`
2020-10-30 20:19:06 +08:00
## Source code
[packages/extension-task-list/ ](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/ )
## Usage
2020-11-04 00:05:27 +08:00
< demo name = "Nodes/TaskList" highlight = "3-5,17-18,37-38" / >