---
title: "toggleList command"
description: "Use the toggleList command in Tiptap to toggle between different types of lists. Learn more in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/api/commands/lists/toggle-list"
---

# toggleList command

Use the toggleList command in Tiptap to toggle between different types of lists. Learn more in our docs!

`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

`keepMarks?: boolean`

If marks should be kept as list items or not

`attributes?: Record<string, any>`

The attributes that should be applied to the list. **This is optional.**

## Use the toggleList command

```js
// toggle a bullet list with list items
editor.commands.toggleList('bulletList', 'listItem')

// toggle a numbered list with list items
editor.commands.toggleList('orderedList', 'listItem')
```
