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.
  1. Roman 1
  1. Decimal 11
  1. Decimal 111
  1. Decimal 112
  1. Decimal 12
  1. Decimal 13
  1. Roman 2
  1. Decimal 11
  1. Decimal 12
  1. Roman 3
  1. 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 or ol) 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.

API Components

useIndentListToolbarButton