tiptap/docs/api/commands/toggle-list.md
2022-06-08 12:41:14 +02:00

491 B

toggleList

toggleList will toggle between different types of lists.

Parameters

listTypeOrName: string | NodeType

The type of node that should be used for the wrapping list

itemTypeOrName: string | NodeType

The type of node that should be used for the list items

Usage

// toggle a bullet list with list items
editor.commands.toggleList('bullet_list', 'list_item')

// toggle a numbered list with list items
editor.commands.toggleList('ordered_list', 'list_item')