2020-10-30 20:19:06 +08:00
# TaskList
2021-01-25 17:35:52 +08:00
[![Version ](https://img.shields.io/npm/v/@tiptap/extension-task-list.svg?label=version )](https://www.npmjs.com/package/@tiptap/extension-task-list)
[![Downloads ](https://img.shields.io/npm/dm/@tiptap/extension-task-list.svg )](https://npmcharts.com/compare/@tiptap/extension-task-list?minimal=true)
2021-04-16 03:48:19 +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 Vanilla JavaScript only.
2020-11-04 00:05:27 +08:00
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
```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
```
2021-02-12 22:02:40 +08:00
This extension requires the [`TaskItem` ](/api/nodes/task-item ) extension.
2020-10-30 20:19:06 +08:00
## 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
2021-03-25 03:39:56 +08:00
* Windows/Linux: `Control` `Shift` `9`
* macOS: `Cmd` `Shift` `9`
2020-11-19 08:16:10 +08:00
2020-10-30 20:19:06 +08:00
## Source code
2021-04-21 21:31:11 +08:00
[packages/extension-task-list/ ](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-task-list/ )
2020-10-30 20:19:06 +08:00
## Usage
2020-11-04 00:05:27 +08:00
< demo name = "Nodes/TaskList" highlight = "3-5,17-18,37-38" / >