Docs
Indent List
Indent List
Turn any block into a list item.
Indent List
Create indented lists with multiple levels of indentation and customize the list style type for each level.
- Roman 1
- Decimal 11
- Decimal 111
- Decimal 112
- Decimal 12
- Decimal 13
- Roman 2
- Decimal 11
- Decimal 12
- Roman 3
- Roman 4
Features
- Set list indentation for various blocks.
- Differs from the List plugin with its flat structure and additional flexibility:
- Any block can be indented as a list.
- Each indented list block consists of a list (
ul
orol
) with a single item. - The list plugin enforces strict rules between parent and children.
- Refer to the Indent documentation for more information.
Installation
npm install @udecode/plate-indent-list @udecode/plate-indent
Usage
// ...
import { createIndentPlugin } from '@udecode/plate-indent';
import { createIndentListPlugin } from '@udecode/plate-indent-list';
const plugins = [
// ...otherPlugins,
createHeadingPlugin(),
createParagraphPlugin(),
createIndentPlugin({
inject: {
props: {
validTypes: [ELEMENT_PARAGRAPH, ELEMENT_H1],
},
},
}),
createIndentListPlugin({
inject: {
props: {
validTypes: [ELEMENT_PARAGRAPH, ELEMENT_H1],
},
},
}),
];
API
createIndentListPlugin
Parameters
Collapse all
A function to determine indent list options for sibling elements.
A function mapping HTML elements to list style types.
getNextIndentList
getPreviousIndentList
indentList
Increase the list indentation of the selected blocks.
outdentList
Decrease the list indentation of the selected blocks.
someIndentList
toggleIndentList
Toggle indent list.