tiptap/docs/src/docPages/api/nodes/list-item.md

35 lines
1.1 KiB
Markdown
Raw Normal View History

2020-08-19 03:39:41 +08:00
# ListItem
2020-09-23 18:33:45 +08:00
The ListItem extension adds support for the `<li>` HTML tag. Its used for bullet lists and ordered lists and cant really be used without them.
2020-08-19 03:39:41 +08:00
2020-09-23 18:33:45 +08:00
## Installation
2020-08-19 03:39:41 +08:00
::: warning Restrictions
This extension is intended to be used with the [`BulletList`](/api/extensions/bullet-list) or [`OrderedList`](/api/extensions/ordered-list) extension. It doesnt work without at least using one of them.
:::
```bash
2020-10-30 21:24:16 +08:00
# with npm
npm install @tiptap/extension-list-item
2020-10-30 21:24:16 +08:00
# with Yarn
yarn add @tiptap/extension-list-item
```
2020-09-23 18:03:03 +08:00
## Settings
2020-09-10 16:21:24 +08:00
| Option | Type | Default | Description |
| ------ | ------ | ------- | -------------------------------------------- |
2020-09-23 18:33:45 +08:00
| class | string | | Add a custom class to the rendered HTML tag. |
## Commands
*None*
## Keyboard shortcuts
* New list item: `Enter`
* Sink a list item: `Tab`
* Lift a list item: `Shift`&nbsp;`Tab`
2020-09-23 18:33:45 +08:00
## Source code
[packages/extension-list-item/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-list-item/)
## Usage
2020-09-24 23:27:26 +08:00
<demo name="Extensions/ListItem" highlight="3-8,20-22,41-43" />